public abstract class BaseDaoImpl<M extends BaseMapper,T,ID> extends Object implements Dao<T,ID>
| 构造器和说明 |
|---|
BaseDaoImpl() |
| 限定符和类型 | 方法和说明 |
|---|---|
protected void |
checkIdType() |
protected int |
count(Consumer<Where> consumer)
是否存在
|
protected int |
count(Where where)
是否存在
|
protected int |
countAll()
总数
|
protected org.apache.ibatis.cursor.Cursor<T> |
cursor(Consumer<Where> consumer)
列表查询,返回类型,当前实体类
|
protected org.apache.ibatis.cursor.Cursor<T> |
cursor(Consumer<Where> consumer,
Getter<T>... selectFields)
列表查询,返回类型,当前实体类
|
protected org.apache.ibatis.cursor.Cursor<T> |
cursor(Where where)
列表查询,返回类型,当前实体类
|
protected org.apache.ibatis.cursor.Cursor<T> |
cursor(Where where,
Getter<T>... selectFields)
列表查询,返回类型,当前实体类
|
protected org.apache.ibatis.cursor.Cursor<T> |
cursorAll()
列表查询,返回类型,当前实体类
|
protected <ID extends Serializable> |
cursorByIds(Collection<ID> ids)
列表查询,返回类型,当前实体类
|
protected <ID extends Serializable> |
cursorByIds(Collection<ID> ids,
Getter<T>... selectFields)
列表查询,返回类型,当前实体类
|
protected <ID extends Serializable> |
cursorByIds(ID... ids)
列表查询,返回类型,当前实体类
|
protected <ID extends Serializable> |
cursorByIds(ID[] ids,
Getter<T>... selectFields)
列表查询,返回类型,当前实体类
|
int |
delete(Collection<T> list)
实体类删除
|
protected int |
delete(Consumer<Where> consumer)
动态条件删除
|
int |
delete(T entity)
实体类删除
|
protected int |
delete(Where where)
动态条件删除
|
protected int |
deleteAll()
删除所有数据
|
int |
deleteById(ID id)
根据ID删除
|
int |
deleteByIds(Collection<ID> ids)
根据ID删除
|
int |
deleteByIds(ID... ids)
根据ID删除
|
protected DeleteChain |
deleteChain() |
protected DeleteChain |
deleteChain(Where where) |
protected boolean |
exists(Consumer<Where> consumer)
是否存在
|
protected boolean |
exists(Where where)
是否存在
|
protected T |
get(Consumer<Where> consumer)
单个查询
|
protected T |
get(Consumer<Where> consumer,
Getter<T>... selectFields)
单个查询
|
protected T |
get(Where where)
单个查询
|
protected T |
get(Where where,
Getter<T>... selectFields)
单个查询
|
T |
getById(ID id)
根据ID查询
|
T |
getById(ID id,
Getter<T>... selectFields)
根据ID查询
|
Class<T> |
getEntityType()
获取ID的类型
|
Class<ID> |
getIdType()
获取ID的类型
|
protected M |
getMapper() |
protected TableInfo |
getTableInfo() |
protected InsertChain |
insertChain() |
protected List<T> |
list(Consumer<Where> consumer)
列表查询,返回类型,当前实体类
|
protected List<T> |
list(Consumer<Where> consumer,
Getter<T>... selectFields)
列表查询,返回类型,当前实体类
|
protected List<T> |
list(Integer limit,
Consumer<Where> consumer)
列表查询,返回类型,当前实体类
|
protected List<T> |
list(Integer limit,
Consumer<Where> consumer,
Getter<T>... selectFields)
列表查询,返回类型,当前实体类
|
protected List<T> |
list(Integer limit,
Where where)
列表查询,返回类型,当前实体类
|
protected List<T> |
list(Integer limit,
Where where,
Getter<T>... selectFields)
列表查询,返回类型,当前实体类
|
protected List<T> |
list(Where where)
列表查询,返回类型,当前实体类
|
protected List<T> |
list(Where where,
Getter<T>... selectFields)
列表查询,返回类型,当前实体类
|
protected List<T> |
listAll()
查所有
|
protected <ID extends Serializable> |
listByIds(Collection<ID> ids)
列表查询,返回类型,当前实体类
|
protected <ID extends Serializable> |
listByIds(Collection<ID> ids,
Getter<T>... selectFields)
列表查询,返回类型,当前实体类
|
protected <ID extends Serializable> |
listByIds(ID... ids)
列表查询,返回类型,当前实体类
|
protected <ID extends Serializable> |
listByIds(ID[] ids,
Getter<T>... selectFields)
列表查询,返回类型,当前实体类
|
Map<ID,T> |
map(Collection<ID> ids)
实体类结果转成Map
|
Map<ID,T> |
map(ID... ids)
实体类结果转成Map
|
protected <K,ID extends Serializable> |
mapWithKey(GetterFun<T,K> mapKey,
Collection<ID> ids)
根据多个id查询结果转map
|
protected <K> Map<K,T> |
mapWithKey(GetterFun<T,K> mapKey,
Consumer<Where> consumer)
根据多个id查询结果转map
|
protected <K,ID extends Serializable> |
mapWithKey(GetterFun<T,K> mapKey,
ID... ids)
根据多个id查询结果转map
|
protected <P extends IPager<T>> |
paging(P pager,
Consumer<Where> consumer)
分页查询
|
protected <P extends IPager<T>> |
paging(P pager,
Consumer<Where> consumer,
Getter<T>... selectFields)
分页查询
|
protected <P extends IPager<T>> |
paging(P pager,
Where where)
分页查询
|
protected <P extends IPager<T>> |
paging(P pager,
Where where,
Getter<T>... selectFields) |
protected QueryChain<T> |
queryChain() |
protected QueryChain<T> |
queryChain(Where where) |
int |
save(Collection<T> list)
实体类保存
|
int |
save(Collection<T> list,
boolean allFieldForce)
实体类保存
|
int |
save(Collection<T> list,
Consumer<SaveStrategy<T>> saveStrategy)
实体类保存
|
int |
save(Collection<T> list,
Getter<T>... forceFields)
实体类保存
|
<M extends Model<T>> |
save(M model)
实体类Model保存
|
<M extends Model<T>> |
save(M model,
boolean allFieldForce)
实体类Model保存
|
<M extends Model<T>> |
save(M model,
Consumer<SaveStrategy<M>> saveStrategy)
实体类Model保存
|
<M extends Model<T>> |
save(M model,
Getter<M>... forceFields)
实体类Model保存
|
int |
save(T entity)
实体类保存
|
int |
save(T entity,
boolean allFieldForce)
实体类保存
|
int |
save(T entity,
Consumer<SaveStrategy<T>> saveStrategy)
实体类保存
|
int |
save(T entity,
Getter<T>... forceFields)
实体类保存
|
int |
saveBatch(Collection<T> list)
原生批量插入
|
int |
saveBatch(Collection<T> list,
Consumer<SaveBatchStrategy<T>> saveBatchStrategy)
原生批量插入
|
<M extends Model<T>> |
saveModel(Collection<M> list)
实体类Model保存
|
<M extends Model<T>> |
saveModel(Collection<M> list,
boolean allFieldForce)
实体类Model保存
|
<M extends Model<T>> |
saveModel(Collection<M> list,
Consumer<SaveStrategy<M>> saveStrategy)
实体类Model保存
|
<M extends Model<T>> |
saveModel(Collection<M> list,
Getter<M>... forceFields)
实体类Model保存
|
<M extends Model<T>> |
saveModelBatch(Collection<M> list)
原生批量插入 实体类Model保存
|
<M extends Model<T>> |
saveModelBatch(Collection<M> list,
Consumer<SaveBatchStrategy<M>> saveBatchStrategy)
原生批量插入 实体类Model保存
|
int |
saveOrUpdate(Collection<T> list)
实体类保存或修改
|
int |
saveOrUpdate(Collection<T> list,
boolean allFieldForce)
实体类保存或修改
|
int |
saveOrUpdate(Collection<T> list,
Consumer<SaveOrUpdateStrategy<T>> saveOrUpdateStrategy)
实体类保存或修改
|
int |
saveOrUpdate(Collection<T> list,
Getter<T>... forceFields)
实体类保存或修改
|
<M extends Model<T>> |
saveOrUpdate(M model)
实体类Model保存或修改
|
<M extends Model<T>> |
saveOrUpdate(M model,
boolean allFieldForce)
实体类Model保存或修改
|
<M extends Model<T>> |
saveOrUpdate(M model,
Consumer<SaveOrUpdateStrategy<M>> saveOrUpdateStrategy)
实体类Model保存或修改
|
<M extends Model<T>> |
saveOrUpdate(M model,
Getter<M>... forceFields)
实体类Model保存或修改
|
int |
saveOrUpdate(T entity)
实体类保存或修改
|
int |
saveOrUpdate(T entity,
boolean allFieldForce)
实体类保存或修改
|
int |
saveOrUpdate(T entity,
Consumer<SaveOrUpdateStrategy<T>> saveOrUpdateStrategy)
实体类保存或修改
|
int |
saveOrUpdate(T entity,
Getter<T>... forceFields)
实体类保存或修改
|
<M extends Model<T>> |
saveOrUpdateModel(Collection<M> list)
实体类Model保存或修改
|
<M extends Model<T>> |
saveOrUpdateModel(Collection<M> list,
boolean allFieldForce)
实体类Model保存或修改
|
<M extends Model<T>> |
saveOrUpdateModel(Collection<M> list,
Consumer<SaveOrUpdateStrategy<M>> saveOrUpdateStrategy)
实体类Model保存或修改
|
<M extends Model<T>> |
saveOrUpdateModel(Collection<M> list,
Getter<M>... forceFields)
实体类Model保存或修改
|
protected void |
setMapper(M mapper) |
protected int |
truncate()
TRUNCATE TABLE
|
int |
update(Collection<T> list)
实体类修改
|
int |
update(Collection<T> list,
boolean allFieldForce)
实体类修改
|
int |
update(Collection<T> list,
Getter<T>... forceFields)
实体类修改
|
int |
update(Collection<T> list,
UpdateStrategy<T> updateStrategy)
实体类保存
|
<M extends Model<T>> |
update(M model)
实体类Model修改
|
<M extends Model<T>> |
update(M model,
boolean allFieldForce)
实体类Model修改
|
<M extends Model<T>> |
update(M model,
Getter<M>... forceFields)
实体类Model修改
|
<M extends Model<T>> |
update(M model,
UpdateStrategy<M> updateStrategy)
修改策略
|
int |
update(T entity)
实体类修改
|
int |
update(T entity,
boolean allFieldForce)
实体类修改
|
protected int |
update(T entity,
Consumer<Where> where)
动态条件修改
|
int |
update(T entity,
Getter<T>... forceFields)
实体类修改
|
int |
update(T entity,
UpdateStrategy<T> updateStrategy)
实体类修改
|
protected int |
update(T entity,
Where where)
指定where 修改
|
protected UpdateChain |
updateChain() |
protected UpdateChain |
updateChain(Where where) |
<M extends Model<T>> |
updateModel(Collection<M> list)
实体类Model修改
|
<M extends Model<T>> |
updateModel(Collection<M> list,
boolean allFieldForce)
实体类Model修改
|
<M extends Model<T>> |
updateModel(Collection<M> list,
Consumer<UpdateStrategy<M>> updateStrategy)
实体类Model修改
|
<M extends Model<T>> |
updateModel(Collection<M> list,
Getter<M>... forceFields)
实体类Model修改
|
protected int |
updateWithStrategy(Collection<T> list,
Consumer<UpdateStrategy<T>> updateStrategy) |
protected <M extends Model<T>> |
updateWithStrategy(M model,
Consumer<UpdateStrategy<M>> updateStrategy) |
protected int |
updateWithStrategy(T entity,
Consumer<UpdateStrategy<T>> updateStrategy) |
protected M extends BaseMapper mapper
protected M getMapper()
protected void setMapper(M mapper)
protected TableInfo getTableInfo()
public Class<T> getEntityType()
DaogetEntityType 在接口中 Dao<T,ID>protected void checkIdType()
protected QueryChain<T> queryChain()
protected QueryChain<T> queryChain(Where where)
protected UpdateChain updateChain()
protected UpdateChain updateChain(Where where)
protected InsertChain insertChain()
protected DeleteChain deleteChain()
protected DeleteChain deleteChain(Where where)
protected T get(Consumer<Where> consumer, Getter<T>... selectFields)
consumer - where consumerselectFields - select列protected T get(Where where, Getter<T>... selectFields)
where - whereselectFields - select列protected boolean exists(Consumer<Where> consumer)
consumer - where consumerprotected boolean exists(Where where)
where - protected int countAll()
protected int count(Where where)
where - protected <ID extends Serializable> List<T> listByIds(ID... ids)
ID - IDids - 指定IDprotected <ID extends Serializable> List<T> listByIds(ID[] ids, Getter<T>... selectFields)
ID - IDids - 指定IDselectFields - select指定列protected <ID extends Serializable> List<T> listByIds(Collection<ID> ids)
ID - IDids - 指定IDprotected <ID extends Serializable> List<T> listByIds(Collection<ID> ids, Getter<T>... selectFields)
ID - IDids - 指定IDselectFields - select指定列protected List<T> list(Consumer<Where> consumer)
consumer - where consumerprotected List<T> list(Consumer<Where> consumer, Getter<T>... selectFields)
consumer - where consumerselectFields - select指定列protected List<T> list(Integer limit, Consumer<Where> consumer)
limit - 条数consumer - where consumerprotected List<T> list(Integer limit, Consumer<Where> consumer, Getter<T>... selectFields)
limit - 条数consumer - where consumerselectFields - select指定列protected List<T> list(Where where, Getter<T>... selectFields)
where - whereselectFields - select指定列protected List<T> list(Integer limit, Where where)
limit - 条数where - whereprotected List<T> list(Integer limit, Where where, Getter<T>... selectFields)
limit - 条数where - whereselectFields - select指定列protected <ID extends Serializable> org.apache.ibatis.cursor.Cursor<T> cursorByIds(ID... ids)
ID - ids - 指定IDprotected <ID extends Serializable> org.apache.ibatis.cursor.Cursor<T> cursorByIds(ID[] ids, Getter<T>... selectFields)
ID - ids - 指定IDselectFields - select指定列protected <ID extends Serializable> org.apache.ibatis.cursor.Cursor<T> cursorByIds(Collection<ID> ids)
ID - ids - 指定IDprotected <ID extends Serializable> org.apache.ibatis.cursor.Cursor<T> cursorByIds(Collection<ID> ids, Getter<T>... selectFields)
ID - ids - 指定IDselectFields - select指定列protected org.apache.ibatis.cursor.Cursor<T> cursor(Consumer<Where> consumer)
consumer - where consumerprotected org.apache.ibatis.cursor.Cursor<T> cursor(Consumer<Where> consumer, Getter<T>... selectFields)
consumer - where consumerselectFields - select指定列protected org.apache.ibatis.cursor.Cursor<T> cursor(Where where)
where - whereprotected org.apache.ibatis.cursor.Cursor<T> cursor(Where where, Getter<T>... selectFields)
where - whereselectFields - select指定列protected org.apache.ibatis.cursor.Cursor<T> cursorAll()
protected <P extends IPager<T>> P paging(P pager, Consumer<Where> consumer)
consumer - where consumerpager - 分页参数protected <P extends IPager<T>> P paging(P pager, Consumer<Where> consumer, Getter<T>... selectFields)
consumer - where consumerpager - pagerselectFields - select指定列protected <P extends IPager<T>> P paging(P pager, Where where)
where - wherepager - 分页参数protected <K,ID extends Serializable> Map<K,T> mapWithKey(GetterFun<T,K> mapKey, ID... ids)
K - map的key的类型mapKey - map的keyids - idsprotected <K,ID extends Serializable> Map<K,T> mapWithKey(GetterFun<T,K> mapKey, Collection<ID> ids)
K - map的key的类型mapKey - map的keyids - idsprotected <K> Map<K,T> mapWithKey(GetterFun<T,K> mapKey, Consumer<Where> consumer)
K - map的key的类型mapKey - map的keyconsumer - where consumerpublic int save(T entity, Consumer<SaveStrategy<T>> saveStrategy)
Daopublic int saveOrUpdate(T entity, Consumer<SaveOrUpdateStrategy<T>> saveOrUpdateStrategy)
DaosaveOrUpdate 在接口中 Dao<T,ID>entity - 实体类对象saveOrUpdateStrategy - 策略public int saveOrUpdate(T entity)
DaosaveOrUpdate 在接口中 Dao<T,ID>entity - 实体类对象public int saveOrUpdate(T entity, boolean allFieldForce)
DaosaveOrUpdate 在接口中 Dao<T,ID>entity - 实体类对象allFieldForce - 是否所有字段都保存或修改,如果是null值,则变成NULLpublic int saveOrUpdate(T entity, Getter<T>... forceFields)
DaosaveOrUpdate 在接口中 Dao<T,ID>entity - 实体类对象forceFields - 是否所有字段都保存或修改,如果是null值,则变成NULLpublic int saveOrUpdate(Collection<T> list, Consumer<SaveOrUpdateStrategy<T>> saveOrUpdateStrategy)
DaosaveOrUpdate 在接口中 Dao<T,ID>list - 实体类对象Listpublic int saveOrUpdate(Collection<T> list)
DaosaveOrUpdate 在接口中 Dao<T,ID>list - 实体类对象Listpublic int saveOrUpdate(Collection<T> list, boolean allFieldForce)
DaosaveOrUpdate 在接口中 Dao<T,ID>list - 实体类对象ListallFieldForce - 是否所有字段都保存或修改,如果是null值,则变成NULLpublic int saveOrUpdate(Collection<T> list, Getter<T>... forceFields)
DaosaveOrUpdate 在接口中 Dao<T,ID>list - 实体类对象ListforceFields - 是否所有字段都保存或修改,如果是null值,则变成NULLpublic int save(Collection<T> list, Consumer<SaveStrategy<T>> saveStrategy)
Daopublic int save(Collection<T> list)
Daopublic int save(Collection<T> list, boolean allFieldForce)
Daopublic int save(Collection<T> list, Getter<T>... forceFields)
Daopublic int saveBatch(Collection<T> list, Consumer<SaveBatchStrategy<T>> saveBatchStrategy)
Daopublic int saveBatch(Collection<T> list)
Daopublic <M extends Model<T>> int save(M model, Consumer<SaveStrategy<M>> saveStrategy)
Daopublic <M extends Model<T>> int save(M model, Getter<M>... forceFields)
Daopublic <M extends Model<T>> int saveModel(Collection<M> list, Consumer<SaveStrategy<M>> saveStrategy)
Daopublic <M extends Model<T>> int saveModel(Collection<M> list)
Daopublic <M extends Model<T>> int saveModel(Collection<M> list, boolean allFieldForce)
Daopublic <M extends Model<T>> int saveModel(Collection<M> list, Getter<M>... forceFields)
Daopublic <M extends Model<T>> int saveModelBatch(Collection<M> list)
DaosaveModelBatch 在接口中 Dao<T,ID>list - 实体类Model对象Listpublic <M extends Model<T>> int saveModelBatch(Collection<M> list, Consumer<SaveBatchStrategy<M>> saveBatchStrategy)
DaosaveModelBatch 在接口中 Dao<T,ID>list - 实体类Model对象ListsaveBatchStrategy - 保存策略public <M extends Model<T>> int saveOrUpdate(M model, Consumer<SaveOrUpdateStrategy<M>> saveOrUpdateStrategy)
DaosaveOrUpdate 在接口中 Dao<T,ID>model - 实体类Model对象saveOrUpdateStrategy - 策略public <M extends Model<T>> int saveOrUpdate(M model)
DaosaveOrUpdate 在接口中 Dao<T,ID>model - 实体类Model对象public <M extends Model<T>> int saveOrUpdate(M model, boolean allFieldForce)
DaosaveOrUpdate 在接口中 Dao<T,ID>model - 实体类Model对象allFieldForce - 是否所有字段都保存或修改,如果是null值,则变成NULLpublic <M extends Model<T>> int saveOrUpdate(M model, Getter<M>... forceFields)
DaosaveOrUpdate 在接口中 Dao<T,ID>model - 实体类Model对象forceFields - 是否所有字段都保存或修改,如果是null值,则变成NULLpublic <M extends Model<T>> int saveOrUpdateModel(Collection<M> list, Consumer<SaveOrUpdateStrategy<M>> saveOrUpdateStrategy)
DaosaveOrUpdateModel 在接口中 Dao<T,ID>list - 实体类Model对象ListsaveOrUpdateStrategy - 策略public <M extends Model<T>> int saveOrUpdateModel(Collection<M> list)
DaosaveOrUpdateModel 在接口中 Dao<T,ID>list - 实体类Model对象Listpublic <M extends Model<T>> int saveOrUpdateModel(Collection<M> list, boolean allFieldForce)
DaosaveOrUpdateModel 在接口中 Dao<T,ID>list - 实体类Model对象ListallFieldForce - 是否所有字段都保存或修改,如果是null值,则变成NULLpublic <M extends Model<T>> int saveOrUpdateModel(Collection<M> list, Getter<M>... forceFields)
DaosaveOrUpdateModel 在接口中 Dao<T,ID>list - 实体类Model对象ListforceFields - 是否所有字段都保存或修改,如果是null值,则变成NULLprotected int updateWithStrategy(T entity, Consumer<UpdateStrategy<T>> updateStrategy)
public int update(T entity, UpdateStrategy<T> updateStrategy)
Daoprotected int update(T entity, Consumer<Where> where)
entity - 实体类where - whereprotected int update(T entity, Where where)
entity - 实体类对象where - whereprotected int updateWithStrategy(Collection<T> list, Consumer<UpdateStrategy<T>> updateStrategy)
public int update(Collection<T> list, UpdateStrategy<T> updateStrategy)
Daopublic int update(Collection<T> list)
Daopublic int update(Collection<T> list, boolean allFieldForce)
Daopublic int update(Collection<T> list, Getter<T>... forceFields)
Daoprotected <M extends Model<T>> int updateWithStrategy(M model, Consumer<UpdateStrategy<M>> updateStrategy)
public <M extends Model<T>> int update(M model, UpdateStrategy<M> updateStrategy)
Daopublic <M extends Model<T>> int update(M model, Getter<M>... forceFields)
Daopublic <M extends Model<T>> int update(M model, boolean allFieldForce)
Daopublic <M extends Model<T>> int updateModel(Collection<M> list, Consumer<UpdateStrategy<M>> updateStrategy)
DaoupdateModel 在接口中 Dao<T,ID>list - 实体类Model对象ListupdateStrategy - 策略public <M extends Model<T>> int updateModel(Collection<M> list)
DaoupdateModel 在接口中 Dao<T,ID>list - 实体类Model对象Listpublic <M extends Model<T>> int updateModel(Collection<M> list, Getter<M>... forceFields)
DaoupdateModel 在接口中 Dao<T,ID>list - 实体类Model对象ListforceFields - 强制字段,如果是null值,则变成NULLpublic <M extends Model<T>> int updateModel(Collection<M> list, boolean allFieldForce)
DaoupdateModel 在接口中 Dao<T,ID>list - 实体类Model对象ListallFieldForce - 是否所有字段都插入,如果是null值,则变成NULLpublic int delete(Collection<T> list)
Daopublic int deleteById(ID id)
DaodeleteById 在接口中 Dao<T,ID>id - IDpublic int deleteByIds(ID... ids)
DaodeleteByIds 在接口中 Dao<T,ID>ids - 多个IDpublic int deleteByIds(Collection<ID> ids)
DaodeleteByIds 在接口中 Dao<T,ID>ids - ID 集合protected int delete(Where where)
where - protected int deleteAll()
protected int truncate()
Copyright © 2025. All rights reserved.