public interface Delegator
| 限定符和类型 | 方法和说明 |
|---|---|
long |
count(EntityScript script) |
long |
count(String entityName,
EntityCondition entityCondition)
Count the entities by EntityCondition
|
List<EntityObject> |
findList(EntityScript script) |
<T> List<T> |
findList(EntityScript script,
Class<T> clazz)
查询多条记录的指定属性列, 并转为对象
|
List<EntityObject> |
findList(String entityName,
EntityCondition whereCondition) |
<T> List<T> |
findList(String entityName,
EntityCondition whereCondition,
Class<T> clazz) |
List<EntityObject> |
findList(String entityName,
QueryArgs queryArgs) |
<T> List<T> |
findList(String entityName,
QueryArgs queryArgs,
Class<T> clazz) |
EntityObject |
findOne(EntityScript script) |
<T> T |
findOne(EntityScript script,
Class<T> clazz)
查询记录的指定属性列, 并转为对象
|
EntityObject |
findOne(String entityName,
EntityCondition entityCondition)
获取唯一记录值
|
<T> T |
findOne(String entityName,
EntityCondition entityCondition,
Class<T> clazz)
获取唯一记录值
|
EntityObject |
findOne(String entityName,
QueryArgs queryArgs) |
<T> T |
findOne(String entityName,
QueryArgs queryArgs,
Class<T> clazz) |
void |
remove(String entityName)
清空所有实体数据
如果实体类实现接口
LogiclyDeletable则逻辑删除 |
void |
remove(String entityName,
EntityCondition EntityCondition)
移除
如果实体类实现接口
LogiclyDeletable则逻辑删除 |
<T> void |
store(String entityName,
T entity)
保存数据
如果实体类继承了
SequencedEntity,那么当实体没有设置主键时,会自动从序列中获取一个新的值作为主键。 |
<T> void |
storeAll(String entityName,
List<T> entities)
批量保存数据
如果实体类继承了
SequencedEntity,那么当实体没有设置主键时,会自动从序列中获取一个新的值作为主键。 |
void |
update(String entityName,
Map<String,Object> fieldsToUpdate,
EntityCondition condition)
更新
|
<T> void store(String entityName, T entity) throws EntityException
保存数据
如果实体类继承了SequencedEntity,那么当实体没有设置主键时,会自动从序列中获取一个新的值作为主键。T - 泛型entityName - 实体名称entity - IdentifyEntity implementsEntityException - 实体错误<T> void storeAll(String entityName, List<T> entities) throws EntityException
批量保存数据
如果实体类继承了SequencedEntity,那么当实体没有设置主键时,会自动从序列中获取一个新的值作为主键。T - 泛型entityName - 实体名称entities - 实体EntityException - 实体错误void update(String entityName, Map<String,Object> fieldsToUpdate, EntityCondition condition) throws EntityException
entityName - 实体名称fieldsToUpdate - 更新的字段及新的值condition - 条件EntityException - 实体错误<T> T findOne(String entityName, EntityCondition entityCondition, Class<T> clazz) throws EntityException
T - 泛型entityName - 实体名称entityCondition - 查询条件clazz - 实体类型EntityException - 实体错误EntityObject findOne(String entityName, EntityCondition entityCondition) throws EntityException
entityName - 实体名称entityCondition - 查询条件EntityException - 实体错误void remove(String entityName, EntityCondition EntityCondition) throws EntityException
移除
如果实体类实现接口LogiclyDeletable则逻辑删除entityName - 实体名称EntityCondition - 条件EntityExceptionvoid remove(String entityName) throws EntityException
清空所有实体数据
如果实体类实现接口LogiclyDeletable则逻辑删除entityName - 实体名称EntityException<T> List<T> findList(String entityName, QueryArgs queryArgs, Class<T> clazz) throws EntityException
T - 泛型entityName - 实体名称queryArgs - 查询参数clazz - 类型EntityException - 查询异常List<EntityObject> findList(String entityName, QueryArgs queryArgs) throws EntityException
entityName - 实体名称queryArgs - 查询参数EntityException - 查询异常<T> List<T> findList(String entityName, EntityCondition whereCondition, Class<T> clazz) throws EntityException
T - 泛型entityName - 实体名称whereCondition - 查询条件clazz - 类型EntityException - 查询异常List<EntityObject> findList(String entityName, EntityCondition whereCondition) throws EntityException
entityName - 实体名称whereCondition - 查询条件EntityException - 查询异常long count(String entityName, EntityCondition entityCondition) throws EntityException
entityName - 实体名称entityCondition - 查询条件EntityException - 查询异常long count(EntityScript script) throws EntityException
script - 查询脚本EntityException - 查询异常<T> T findOne(EntityScript script, Class<T> clazz) throws EntityException
T - 实体泛型script - 查询脚本clazz - 实体类型EntityException - 查询异常EntityObject findOne(EntityScript script) throws EntityException
script - 查询脚本EntityException - 查询异常<T> List<T> findList(EntityScript script, Class<T> clazz) throws EntityException
T - 实体泛型script - 查询脚本clazz - 实体类型EntityException - 查询异常List<EntityObject> findList(EntityScript script) throws EntityException
script - 查询脚本EntityException - 查询异常EntityObject findOne(String entityName, QueryArgs queryArgs) throws EntityException
EntityException<T> T findOne(String entityName, QueryArgs queryArgs, Class<T> clazz) throws EntityException
EntityExceptionCopyright © 2019. All rights reserved.