| 构造器和说明 |
|---|
GenericDelegator() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addGenerator(IdGenerator generator) |
void |
addGenerator(List<IdGenerator> generators) |
long |
count(EntityScript script) |
long |
count(String entityName,
EntityCondition whereCondition)
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则逻辑删除 |
void |
setEntityInterceptor(EntityInterceptor entityInterceptor) |
void |
setScriptExecutor(EntityScriptExecutor scriptExecutor) |
<T> void |
store(String entityName,
T entity)
保存数据
如果实体类继承了
SequencedEntity,那么当实体没有设置主键时,会自动从序列中获取一个新的值作为主键。 |
<T> void |
storeAll(String entityName,
List<T> entities)
批量保存数据
如果实体类继承了
SequencedEntity,那么当实体没有设置主键时,会自动从序列中获取一个新的值作为主键。 |
void |
update(String entityName,
Map<String,Object> fieldsToSet,
EntityCondition condition)
更新
|
public void setScriptExecutor(EntityScriptExecutor scriptExecutor)
public void setEntityInterceptor(EntityInterceptor entityInterceptor)
public <T> void store(String entityName, T entity) throws EntityException
Delegator保存数据
如果实体类继承了SequencedEntity,那么当实体没有设置主键时,会自动从序列中获取一个新的值作为主键。store 在接口中 DelegatorT - 泛型entityName - 实体名称entity - IdentifyEntity implementsEntityException - 实体错误public <T> void storeAll(String entityName, List<T> entities) throws EntityException
Delegator批量保存数据
如果实体类继承了SequencedEntity,那么当实体没有设置主键时,会自动从序列中获取一个新的值作为主键。storeAll 在接口中 DelegatorT - 泛型entityName - 实体名称entities - 实体EntityException - 实体错误public void addGenerator(IdGenerator generator)
public void addGenerator(List<IdGenerator> generators)
public <T> T findOne(String entityName, EntityCondition EntityCondition, Class<T> clazz) throws EntityException
DelegatorfindOne 在接口中 DelegatorT - 泛型entityName - 实体名称EntityCondition - 查询条件clazz - 实体类型EntityException - 实体错误public void update(String entityName, Map<String,Object> fieldsToSet, EntityCondition condition) throws EntityException
Delegatorupdate 在接口中 DelegatorentityName - 实体名称fieldsToSet - 更新的字段及新的值condition - 条件EntityException - 实体错误public void remove(String entityName) throws EntityException
Delegator清空所有实体数据
如果实体类实现接口LogiclyDeletable则逻辑删除remove 在接口中 DelegatorentityName - 实体名称EntityExceptionpublic void remove(String entityName, EntityCondition EntityCondition) throws EntityException
Delegator移除
如果实体类实现接口LogiclyDeletable则逻辑删除remove 在接口中 DelegatorentityName - 实体名称EntityCondition - 条件EntityExceptionpublic <T> List<T> findList(String entityName, QueryArgs queryArgs, Class<T> clazz) throws EntityException
findList 在接口中 DelegatorT - 泛型entityName - 实体名称queryArgs - 查询参数clazz - 类型EntityException - 查询异常public long count(String entityName, EntityCondition whereCondition) throws EntityException
Delegatorcount 在接口中 DelegatorentityName - 实体名称whereCondition - 查询条件EntityException - 查询异常public long count(EntityScript script) throws EntityException
count 在接口中 Delegatorscript - 查询脚本EntityException - 查询异常public List<EntityObject> findList(EntityScript script) throws EntityException
findList 在接口中 Delegatorscript - 查询脚本EntityException - 查询异常public EntityObject findOne(String entityName, QueryArgs queryArgs) throws EntityException
findOne 在接口中 DelegatorEntityExceptionpublic <T> T findOne(String entityName, QueryArgs queryArgs, Class<T> clazz) throws EntityException
findOne 在接口中 DelegatorEntityExceptionpublic <T> T findOne(EntityScript script, Class<T> clazz) throws EntityException
DelegatorfindOne 在接口中 DelegatorT - 实体泛型script - 查询脚本clazz - 实体类型EntityException - 查询异常public <T> List<T> findList(EntityScript script, Class<T> clazz) throws EntityException
DelegatorfindList 在接口中 DelegatorT - 实体泛型script - 查询脚本clazz - 实体类型EntityException - 查询异常public EntityObject findOne(String entityName, EntityCondition entityCondition) throws EntityException
DelegatorfindOne 在接口中 DelegatorentityName - 实体名称entityCondition - 查询条件EntityException - 实体错误public List<EntityObject> findList(String entityName, QueryArgs queryArgs) throws EntityException
findList 在接口中 DelegatorentityName - 实体名称queryArgs - 查询参数EntityException - 查询异常public <T> List<T> findList(String entityName, EntityCondition whereCondition, Class<T> clazz) throws EntityException
findList 在接口中 DelegatorT - 泛型entityName - 实体名称whereCondition - 查询条件clazz - 类型EntityException - 查询异常public List<EntityObject> findList(String entityName, EntityCondition whereCondition) throws EntityException
findList 在接口中 DelegatorentityName - 实体名称whereCondition - 查询条件EntityException - 查询异常public EntityObject findOne(EntityScript script) throws EntityException
findOne 在接口中 Delegatorscript - 查询脚本EntityException - 查询异常Copyright © 2019. All rights reserved.