T - The entity typeID - The identity type of entitypublic interface Dao<T extends Entity<ID>,ID extends java.io.Serializable>
| Modifier and Type | Method and Description |
|---|---|
long |
count(Condition<T> condition)
Returns records count by conditions
|
void |
delete(Condition<T> condition)
Delete by conditions
|
void |
deleteOne(ID id)
Delete by entity id
|
boolean |
exists(Condition<T> condition)
Check exists by conditions
|
default boolean |
exists(ID id)
Check exists of entity id
|
java.util.List<T> |
find(Condition<T> condition)
Find by conditions
|
default java.util.List<T> |
findAll()
Find all records
|
T |
findFirst(Condition<T> condition)
Find first record by conditions
|
T |
findOne(ID id)
Find entity by id
|
default PageData<T> |
paging(Condition<T> condition)
Returns paged entities by conditions
|
void |
save(java.util.List<T> entities)
Save many entities
|
void |
saveOne(T entity)
Save one entity
|
default void |
saveOrUpdate(T entity)
Save or update entity, if the entity has id value, then update it
|
default PageData<T> |
sliceup(Condition<T> condition)
Returns paged entities by conditions
|
void |
update(T entity)
Update entity by id
|
void |
updateCondition(T update,
T condition)
Update entities by condition
|
void |
updateConditionNullable(T update,
T condition)
Update entities by condition
|
boolean |
updateIncremental(T entity,
boolean canNegative)
Incremental update by id, can only update number properties
|
void |
updateNullable(T entity)
Update entity by id, and null value properties update to null
|
void saveOne(T entity)
entity - Entityvoid save(java.util.List<T> entities)
entities - The entitiesdefault void saveOrUpdate(T entity)
entity - Entityvoid deleteOne(ID id)
id - Entity idT findFirst(Condition<T> condition)
condition - The conditionsdefault java.util.List<T> findAll()
java.util.List<T> find(Condition<T> condition)
condition - The conditionslong count(Condition<T> condition)
condition - The conditionsdefault PageData<T> sliceup(Condition<T> condition)
condition - The conditionsdefault PageData<T> paging(Condition<T> condition)
condition - The conditionsdefault boolean exists(ID id)
id - The entity idboolean exists(Condition<T> condition)
condition - The conditionsvoid update(T entity)
entity - The entity with id valueboolean updateIncremental(@Param(value="update")
T entity,
@Param(value="canNegative")
boolean canNegative)
entity - The entity with id valuecanNegative - true: Can update to negative valuevoid updateCondition(@Param(value="update")
T update,
@Param(value="condition")
T condition)
update - The values to be updatecondition - The conditionvoid updateNullable(T entity)
entity - The entity with id valueCopyright © 2020. All Rights Reserved.