public class CommonServiceImpl extends AbstractServiceSupport implements CommonService
| 限定符和类型 | 字段和说明 |
|---|---|
protected BaseRepository |
baseRepository |
protected PojoTableManager |
pojoTableManager |
| 构造器和说明 |
|---|
CommonServiceImpl(BaseRepository baseRepository,
PojoTableManager pojoTableManager) |
| 限定符和类型 | 方法和说明 |
|---|---|
<T> SearchParam<T> |
buildSearchParam(Class<T> pojoType)
构造一个指定实体的基础查询参数
|
protected Condition |
initCondition(Class<?> pojoType)
初始化默认查询条件
如果pojo存在逻辑删除字段,则添加逻辑删除字段控制
|
<T> List<T> |
select(SearchParam<T> searchParam)
查询方法泛型重载
|
<T> T |
selectById(Class<T> pojoType,
Object id)
根据主键查询
|
<T> List<T> |
selectByIds(Class<T> pojoType,
Collection<Object> ids)
根据主键集合查询
|
<T> PageResult<T> |
selectPage(SearchParam<T> searchParam)
查询方法泛型重载
|
<T> T |
selectSingleObj(SearchParam<T> searchParam)
查询单条数据
如果结果集大于1条,则抛出 IncorrectResultSizeDataAccessException异常
|
adaptTransactionTemplateManager, getDeleteByInferTransactionTemplate, getDeleteByInferTransactionTemplate, getDeleteTransactionTemplate, getDeleteTransactionTemplate, getJdbcOperationHolderAdapter, getLogicDeleteTransactionTemplate, getLogicDeleteTransactionTemplate, getSaveTransactionTemplate, getSaveTransactionTemplate, getSelectTransactionTemplate, getSelectTransactionTemplate, getTransactionTemplateclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitadaptTransactionTemplateManagerprotected final BaseRepository baseRepository
protected final PojoTableManager pojoTableManager
public CommonServiceImpl(BaseRepository baseRepository, PojoTableManager pojoTableManager)
public <T> SearchParam<T> buildSearchParam(Class<T> pojoType)
CommonServicebuildSearchParam 在接口中 CommonServicepojoType - 实体类型public <T> List<T> select(SearchParam<T> searchParam)
CommonServiceselect 在接口中 CommonServicesearchParam - 查询参数public <T> PageResult<T> selectPage(SearchParam<T> searchParam)
CommonServiceselectPage 在接口中 CommonServicesearchParam - 查询参数public <T> T selectSingleObj(SearchParam<T> searchParam)
CommonServiceselectSingleObj 在接口中 CommonServicesearchParam - 查询参数public <T> T selectById(Class<T> pojoType, Object id)
CommonServiceselectById 在接口中 CommonServiceid - 主键public <T> List<T> selectByIds(Class<T> pojoType, Collection<Object> ids)
CommonServiceselectByIds 在接口中 CommonServiceids - 主键集合Copyright © 2022. All rights reserved.