@Transactional(rollbackFor=java.lang.Throwable.class) public abstract class GenericEntityService<E extends GenericEntity<PK>,PK> extends AbstractService<E,PK> implements GenericService<E,PK>
| 限定符和类型 | 字段和说明 |
|---|---|
protected org.springframework.context.ApplicationEventPublisher |
eventPublisher |
entityFactory, entityType, logger, logicPrimaryKeyValidator, primaryKeyType, validator| 构造器和说明 |
|---|
GenericEntityService() |
| 限定符和类型 | 方法和说明 |
|---|---|
protected boolean |
dataExisted(E entity) |
E |
deleteByPk(PK pk)
根据主键删除记录
|
protected abstract org.hswebframework.web.id.IDGenerator<PK> |
getIDGenerator()
获取ID生成器,在insert的时候,如果ID为空,则调用生成器进行生成
|
void |
init() |
PK |
insert(E entity) |
protected boolean |
physicalDeleteByPk(PK pk) |
protected boolean |
pushCreatedEvent() |
protected boolean |
pushModifyEvent() |
PK |
saveOrUpdate(E entity) |
List<E> |
selectByPk(List<PK> id) |
E |
selectByPk(PK pk) |
void |
setEventPublisher(org.springframework.context.ApplicationEventPublisher eventPublisher) |
protected int |
updateByPk(E entity) |
int |
updateByPk(List<E> data) |
int |
updateByPk(PK pk,
E entity) |
assertNotNull, assertNotNull, createEntity, entityFactoryIsEnabled, getEntityInstanceType, getEntityType, getPrimaryKeyType, setEntityFactory, setLogicPrimaryKeyValidator, setValidator, tryValidate, tryValidate, tryValidate, tryValidateProperty, tryValidateProperty, tryValidatePropertyclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetDaocount, createQuery, createQuery, selectcount, select, selectPager, selectSinglecreateUpdate, createUpdate, createUpdate, createUpdatecreateDelete, createDelete, createDeletecreateEntity, getEntityInstanceTypeprotected org.springframework.context.ApplicationEventPublisher eventPublisher
protected abstract org.hswebframework.web.id.IDGenerator<PK> getIDGenerator()
IDGenerator@Autowired(required=false) public void setEventPublisher(org.springframework.context.ApplicationEventPublisher eventPublisher)
@PostConstruct public void init()
public E deleteByPk(PK pk)
DefaultDeleteServicedeleteByPk 在接口中 DefaultDeleteService<E extends GenericEntity<PK>,PK>deleteByPk 在接口中 DeleteService<E extends GenericEntity<PK>,PK>pk - 主键protected boolean physicalDeleteByPk(PK pk)
protected boolean pushModifyEvent()
protected boolean pushCreatedEvent()
public int updateByPk(PK pk, E entity)
updateByPk 在接口中 UpdateService<E extends GenericEntity<PK>,PK>protected int updateByPk(E entity)
public int updateByPk(List<E> data)
updateByPk 在接口中 UpdateService<E extends GenericEntity<PK>,PK>public PK saveOrUpdate(E entity)
saveOrUpdate 在接口中 UpdateService<E extends GenericEntity<PK>,PK>protected boolean dataExisted(E entity)
public PK insert(E entity)
insert 在接口中 InsertService<E extends GenericEntity<PK>,PK>@Transactional(readOnly=true) public E selectByPk(PK pk)
selectByPk 在接口中 QueryService<E extends GenericEntity<PK>,PK>@Transactional(readOnly=true) public List<E> selectByPk(List<PK> id)
selectByPk 在接口中 QueryService<E extends GenericEntity<PK>,PK>Copyright © 2016–2019. All rights reserved.