All Downloads are FREE. Search and download functionalities are using the official Maven repository.

shz.core.orm.IService Maven / Gradle / Ivy

There is a newer version: 2024.0.2
Show newest version
package shz.core.orm;

import shz.core.model.PageInfo;
import shz.core.orm.annotation.Where;
import shz.core.orm.enums.Condition;
import shz.core.serializable.SerializableGetter;

import java.util.Collection;
import java.util.List;

public interface IService {
    void delete(Collection ids);

    /**
     * @param fieldNames 指定需要插入的列对应字段,其余列忽略不插入并且指定的列不管是否为空都会强制插入
     */
    int insert(Object entity, List fieldNames);

    /**
     * 没有指定插入列默认会选择非空的列插入{@link Where 中strategy}
     */
    int insert(Object entity);

    /**
     * @param batchSize 批次大小
     */
    int[] batchInsert(List entities, List fieldNames, int batchSize);

    int[] batchInsert(List entities, List fieldNames);

    int[] batchInsert(List entities);

    /**
     * @param fieldNames 指定需要更新的列对应字段,其余列忽略不更新并且指定的列不管是否为空都会强制更新
     */
    int updateById(Object entity, List fieldNames);

    /**
     * 没有指定更新列默认会选择非空的列更新
     */
    int updateById(Object entity);

    int[] batchUpdateById(List entities, List fieldNames, int batchSize);

    int[] batchUpdateById(List entities, List fieldNames);

    int[] batchUpdateById(List entities);

    int updateByColumn(Object entity, List fieldNames, String fieldName, Object fieldValue, Condition condition);

     int updateByColumn(V entity, SerializableGetter fieldName, Object fieldValue, Condition condition);

    /**
     * @param uniqueFields 唯一列,插入时会校验是否存在该列的值
     */
    int insertOrUpdate(Object entity, List fieldNames, String... uniqueFields);

    int insertOrUpdate(Object entity, String... uniqueFields);

    int[] batchInsertOrUpdate(List entities, List fieldNames, int batchSize, String... uniqueFields);

    int[] batchInsertOrUpdate(List entities, List fieldNames, String... uniqueFields);

    int[] batchInsertOrUpdate(List entities, String... uniqueFields);

    int deleteById(Object id);

    int[] batchDeleteById(List ids, int batchSize);

    int[] batchDeleteById(List ids);

    int deleteByColumn(SerializableGetter fieldName, Object fieldValue, Condition condition);

    List selectList(Object obj, List fieldNames);

    List selectList(Object obj);

    List selectListAll();

    List selectListByColumn(List fieldNames, String fieldName, Object fieldValue, Condition condition);

    List selectListByColumn(SerializableGetter fieldName, Object fieldValue, Condition condition);

    PageInfo selectPage(PageInfo pageInfo, Object obj, List fieldNames);

    PageInfo selectPage(PageInfo pageInfo, Object obj);

    PageInfo selectPageAll(PageInfo pageInfo);

    PageInfo selectPageByColumn(PageInfo pageInfo, List fieldNames, String fieldName, Object fieldValue, Condition condition);

    PageInfo selectPageByColumn(PageInfo pageInfo, SerializableGetter fieldName, Object fieldValue, Condition condition);

    T selectById(Object id, List fieldNames);

    T selectById(Object id);

    List selectByIds(Collection ids, List fieldNames);

    List selectByIds(Collection ids);

    T selectOne(Object obj, List fieldNames);

    T selectOne(Object obj);

    T selectOneByColumn(List fieldNames, String fieldName, Object fieldValue, Condition condition);

    T selectOneByColumn(SerializableGetter fieldName, Object fieldValue, Condition condition);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy