public abstract class DaoHolder<T extends OEntity> extends Object implements Dao<T>
| 构造器和说明 |
|---|
DaoHolder() |
| 限定符和类型 | 方法和说明 |
|---|---|
int |
batchInsert(List<T> entities)
批量插入数据
如果entity的id为null,会自动回填id
|
long |
count()
所有数据
|
long |
count(Cnd<T> cnd)
根据筛选条件查询数据个数
|
int |
delete(Cnd<T> cnd)
根据条件物理删除数据
|
int |
deleteById(Long id)
根据主键物理删除数据
|
int |
deleteByIds(List<Long> ids)
根据主键物理删除数据
|
void |
download(SelectTpl<T> tpl,
Cnd<T> cnd,
Consumer<T> consumer)
根据筛选条件,将数据依次传给consumer处理
|
T |
fetch(SelectTpl<T> tpl,
Cnd<T> cnd)
返回匹配到第一条符合条件的数据
(默认是没有被删除的数据),如果获取
|
Page<T> |
find(Cnd<T> cnd)
根据条件筛选数据
注意: 分页页码从0开始,并且总分页数只有再页号非正数时才会返回,如果是第1页想获取中数据数,则page传入-1即可
|
List<T> |
findByIds(List<Long> ids)
返回没有被逻辑删除的,给定ids范围内的数据
|
Page<T> |
findTpl(SelectTpl<T> tpl,
Cnd<T> cnd)
根据条件筛选tpl选中到的字段数据
注意: 分页页码从0开始,并且总分页数只有再页号非正数时才会返回,如果是第1页想获取中数据数,则page传入-1即可
|
T |
get(Long id)
根据id获取对象
即使数据已经被逻辑删除依然能够获取到。
|
DaoHelper |
getDaoHelper() |
T |
insert(T entity)
插入数据
如果entity的id为null,会自动回填id
|
int |
recovery(Cnd<T> cnd)
根据条件回复已经被逻辑删除的数据
|
int |
remove(Cnd<T> cnd)
根据条件逻辑删除数据
|
int |
removeById(Long id)
逻辑删除数据
|
int |
removeByIds(List<Long> ids)
批量逻辑删除数据
|
void |
setDaoHelper(DaoHelper daoHelper) |
int |
update(T entity)
更新数据
entity的id不可为null
|
int |
updateByTpl(UpdateTpl<T> tpl)
根据tpl中的id,特殊的更新数据,如count++等自操作更新等等。
|
int |
updateByTplCnd(UpdateTpl<T> tpl,
Cnd<T> cnd)
根据筛选条件,批量更新数据
|
int |
updateIgnoreNull(T entity)
将非null数据更新到数据哭
entity的id不可为null
|
protected DaoHelper daoHelper
public DaoHelper getDaoHelper()
public void setDaoHelper(DaoHelper daoHelper)
public int batchInsert(List<T> entities)
DaobatchInsert 在接口中 Dao<T extends OEntity>public int updateIgnoreNull(T entity)
DaoupdateIgnoreNull 在接口中 Dao<T extends OEntity>public int updateByTpl(UpdateTpl<T> tpl)
DaoupdateByTpl 在接口中 Dao<T extends OEntity>tpl - 更新模板public int updateByTplCnd(UpdateTpl<T> tpl, Cnd<T> cnd)
DaoupdateByTplCnd 在接口中 Dao<T extends OEntity>tpl - 更新模板cnd - 筛选条件,null值代表不限制public int removeById(Long id)
DaoremoveById 在接口中 Dao<T extends OEntity>public int removeByIds(List<Long> ids)
DaoremoveByIds 在接口中 Dao<T extends OEntity>public int deleteById(Long id)
DaodeleteById 在接口中 Dao<T extends OEntity>public int deleteByIds(List<Long> ids)
DaodeleteByIds 在接口中 Dao<T extends OEntity>public Page<T> find(Cnd<T> cnd)
Daopublic Page<T> findTpl(SelectTpl<T> tpl, Cnd<T> cnd)
Daopublic void download(SelectTpl<T> tpl, Cnd<T> cnd, Consumer<T> consumer)
DaoCopyright © 2018. All rights reserved.