Class GenericRepositoryImpl<E,ID extends Serializable>
- java.lang.Object
-
- org.springframework.data.jpa.repository.support.SimpleJpaRepository<E,ID>
-
- com.devonfw.module.jpa.dataaccess.impl.data.GenericRepositoryImpl<E,ID>
-
- Type Parameters:
E- generic type of the managedentity.ID- generic type of theprimary keyof the entity.
- All Implemented Interfaces:
GenericRepository<E,ID>,QueryDslSupport<E>,FeatureForceIncrementModificationCounter<E>,org.springframework.data.jpa.repository.JpaRepository<E,ID>,org.springframework.data.jpa.repository.JpaSpecificationExecutor<E>,org.springframework.data.jpa.repository.support.JpaRepositoryImplementation<E,ID>,org.springframework.data.repository.CrudRepository<E,ID>,org.springframework.data.repository.PagingAndSortingRepository<E,ID>,org.springframework.data.repository.query.QueryByExampleExecutor<E>,org.springframework.data.repository.Repository<E,ID>
- Direct Known Subclasses:
GenericRevisionedRepositoryImpl
public class GenericRepositoryImpl<E,ID extends Serializable> extends org.springframework.data.jpa.repository.support.SimpleJpaRepository<E,ID> implements GenericRepository<E,ID>
Implementation ofGenericRepositorybased onSimpleJpaRepository. All repository interfaces derived fromGenericRepositorywill be based on this implementation at runtime.
Note: We do not use/extendQuerydslJpaRepositoras it forces you to use QueryDSL APT generation what is not desired. Therefore, you will have no support forQueryDslPredicateExecutor. However, we offer more flexible QueryDSL support anyhow. SeeQueryDslSupport.- Since:
- 3.0.0
-
-
Field Summary
Fields Modifier and Type Field Description protected org.springframework.data.jpa.repository.support.JpaEntityInformation<E,?>entityInformationTheJpaEntityInformation.protected javax.persistence.EntityManagerentityManagerTheEntityManagerinstance.
-
Constructor Summary
Constructors Constructor Description GenericRepositoryImpl(org.springframework.data.jpa.repository.support.JpaEntityInformation<E,ID> entityInformation, javax.persistence.EntityManager entityManager)The constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidforceIncrementModificationCounter(E entity)Class<E>getEntityClass()EnewDslAlias()Attention: Please read documentation ofQueryDslSupportbefore usage.com.querydsl.jpa.impl.JPADeleteClausenewDslDeleteClause(com.querydsl.core.types.EntityPath<E> entityPath)Attention: Please read documentation ofQueryDslSupportbefore usage.com.querydsl.jpa.impl.JPADeleteClausenewDslDeleteClause(E alias)Attention: Please read documentation ofQueryDslSupportbefore usage.com.querydsl.jpa.impl.JPAQuery<E>newDslQuery()Attention: Please read documentation ofQueryDslSupportbefore usage.com.querydsl.jpa.impl.JPAQuery<E>newDslQuery(E alias)Attention: Please read documentation ofQueryDslSupportbefore usage.-
Methods inherited from class org.springframework.data.jpa.repository.support.SimpleJpaRepository
count, count, count, delete, deleteAll, deleteAll, deleteAllInBatch, deleteById, deleteInBatch, exists, existsById, findAll, findAll, findAll, findAll, findAll, findAll, findAll, findAll, findAll, findAllById, findById, findOne, findOne, flush, getCountQuery, getCountQuery, getDomainClass, getOne, getQuery, getQuery, getQuery, getQuery, getQueryHints, getRepositoryMethodMetadata, readPage, readPage, save, saveAll, saveAndFlush, setEscapeCharacter, setRepositoryMethodMetadata
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.springframework.data.repository.CrudRepository
count, delete, deleteAll, deleteAll, deleteById, existsById, findById, save
-
Methods inherited from interface com.devonfw.module.jpa.dataaccess.api.data.GenericRepository
deleteByIds, find
-
Methods inherited from interface org.springframework.data.jpa.repository.JpaRepository
deleteAllInBatch, deleteInBatch, findAll, findAll, findAll, findAll, findAllById, flush, getOne, saveAll, saveAndFlush
-
-
-
-
Field Detail
-
entityManager
protected final javax.persistence.EntityManager entityManager
TheEntityManagerinstance.
-
entityInformation
protected final org.springframework.data.jpa.repository.support.JpaEntityInformation<E,?> entityInformation
TheJpaEntityInformation.
-
-
Constructor Detail
-
GenericRepositoryImpl
public GenericRepositoryImpl(org.springframework.data.jpa.repository.support.JpaEntityInformation<E,ID> entityInformation, javax.persistence.EntityManager entityManager)
The constructor.- Parameters:
entityInformation- theJpaEntityInformation.entityManager- the JPAEntityManager.
-
-
Method Detail
-
forceIncrementModificationCounter
public void forceIncrementModificationCounter(E entity)
- Specified by:
forceIncrementModificationCounterin interfaceFeatureForceIncrementModificationCounter<E>
-
getEntityClass
public Class<E> getEntityClass()
- Specified by:
getEntityClassin interfaceGenericRepository<E,ID extends Serializable>- Returns:
- the
Classof the managed entity.
-
newDslQuery
public com.querydsl.jpa.impl.JPAQuery<E> newDslQuery()
Description copied from interface:QueryDslSupportAttention: Please read documentation ofQueryDslSupportbefore usage.- Specified by:
newDslQueryin interfaceQueryDslSupport<E>- Returns:
- a new
JPAQuery. In most cases you should prefer usingQueryDslSupport.newDslQuery(Object)instead.
-
newDslQuery
public com.querydsl.jpa.impl.JPAQuery<E> newDslQuery(E alias)
Description copied from interface:QueryDslSupportAttention: Please read documentation ofQueryDslSupportbefore usage.- Specified by:
newDslQueryin interfaceQueryDslSupport<E>- Parameters:
alias- thealias.- Returns:
- a new
JPAQueryfor the givenAlias.
-
newDslDeleteClause
public com.querydsl.jpa.impl.JPADeleteClause newDslDeleteClause(E alias)
Description copied from interface:QueryDslSupportAttention: Please read documentation ofQueryDslSupportbefore usage.- Specified by:
newDslDeleteClausein interfaceQueryDslSupport<E>- Parameters:
alias- thealias.- Returns:
- a new
JPADeleteClausefor the givenAlias.
-
newDslDeleteClause
public com.querydsl.jpa.impl.JPADeleteClause newDslDeleteClause(com.querydsl.core.types.EntityPath<E> entityPath)
Description copied from interface:QueryDslSupportAttention: Please read documentation ofQueryDslSupportbefore usage.- Specified by:
newDslDeleteClausein interfaceQueryDslSupport<E>- Parameters:
entityPath- theEntityPathto delete from.- Returns:
- a new
JPADeleteClausefor the givenEntityPath.
-
newDslAlias
public E newDslAlias()
Description copied from interface:QueryDslSupportAttention: Please read documentation ofQueryDslSupportbefore usage.- Specified by:
newDslAliasin interfaceQueryDslSupport<E>- Returns:
- a new QueryDSL
Aliasfor the managed entity.
-
-