Class AbstractService<Repository extends Repository<Entity,ID>,Entity,ID>
- java.lang.Object
-
- com.eoscode.springapitools.service.AbstractService<Repository,Entity,ID>
-
- Direct Known Subclasses:
RepositoryService
public abstract class AbstractService<Repository extends Repository<Entity,ID>,Entity,ID> extends Object
-
-
Constructor Summary
Constructors Constructor Description AbstractService()AbstractService(org.springframework.context.ApplicationContext applicationContext, Type repositoryType, Type entityType, Type identifierType)AbstractService(org.springframework.context.ApplicationContext applicationContext, Repository repository)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description QueryDefinitioncreateQueryDefinition(String query, QueryParameter queryParameter)voiddelete(Entity entity)voiddeleteById(ID id)booleanexistsById(ID id)List<Entity>find(Entity filterBy)org.springframework.data.domain.Page<Entity>find(Entity filterBy, org.springframework.data.domain.Pageable pageable)List<Entity>find(Entity filterBy, org.springframework.data.domain.Sort sort)List<Entity>findAll()List<Entity>findAll(org.springframework.data.domain.Sort sort)org.springframework.data.domain.Page<Entity>findAllWithPage(org.springframework.data.domain.Pageable pageable)EntityfindById(ID id)EntityfindDetailById(ID id)TypegetIdentifierType()protected RepositorygetRepository()TypegetRepositoryType()List<Entity>query(QueryDefinition queryDefinition)org.springframework.data.domain.Page<Entity>query(QueryDefinition queryDefinition, org.springframework.data.domain.Pageable pageable)List<Entity>query(QueryDefinition queryDefinition, org.springframework.data.domain.Sort sort)org.springframework.data.domain.Page<Entity>query(String query, QueryParameter queryParameter, org.springframework.data.domain.Pageable pageable)List<Entity>query(String query, QueryParameter queryParameter, org.springframework.data.domain.Sort sort)Entitysave(Entity entity)Entityupdate(Entity entity)
-
-
-
Constructor Detail
-
AbstractService
public AbstractService()
-
AbstractService
public AbstractService(org.springframework.context.ApplicationContext applicationContext, Type repositoryType, Type entityType, Type identifierType)
-
AbstractService
public AbstractService(org.springframework.context.ApplicationContext applicationContext, Repository repository)
-
-
Method Detail
-
getRepositoryType
public Type getRepositoryType()
-
getIdentifierType
public Type getIdentifierType()
-
getRepository
protected Repository getRepository()
-
update
@Transactional public Entity update(Entity entity) throws EntityNotFoundException
- Throws:
EntityNotFoundException
-
findById
public Entity findById(ID id) throws EntityNotFoundException
- Throws:
EntityNotFoundException
-
findDetailById
public Entity findDetailById(ID id) throws EntityNotFoundException
- Throws:
EntityNotFoundException
-
existsById
public boolean existsById(ID id)
-
deleteById
@Transactional public void deleteById(ID id)
-
delete
@Transactional public void delete(Entity entity)
-
find
public org.springframework.data.domain.Page<Entity> find(Entity filterBy, org.springframework.data.domain.Pageable pageable)
-
query
public List<Entity> query(String query, QueryParameter queryParameter, org.springframework.data.domain.Sort sort)
-
query
public org.springframework.data.domain.Page<Entity> query(String query, QueryParameter queryParameter, org.springframework.data.domain.Pageable pageable)
-
query
public List<Entity> query(QueryDefinition queryDefinition)
-
query
public List<Entity> query(QueryDefinition queryDefinition, org.springframework.data.domain.Sort sort)
-
query
public org.springframework.data.domain.Page<Entity> query(QueryDefinition queryDefinition, org.springframework.data.domain.Pageable pageable)
-
findAllWithPage
public org.springframework.data.domain.Page<Entity> findAllWithPage(org.springframework.data.domain.Pageable pageable)
-
createQueryDefinition
public QueryDefinition createQueryDefinition(String query, QueryParameter queryParameter)
-
-