Class GenericRepositoryImpl<E,​ID extends Serializable>

  • Type Parameters:
    E - generic type of the managed entity.
    ID - generic type of the primary key of 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 of GenericRepository based on SimpleJpaRepository. All repository interfaces derived from GenericRepository will be based on this implementation at runtime.
    Note: We do not use/extend QuerydslJpaRepositor as it forces you to use QueryDSL APT generation what is not desired. Therefore, you will have no support for QueryDslPredicateExecutor. However, we offer more flexible QueryDSL support anyhow. See QueryDslSupport.
    Since:
    3.0.0
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected org.springframework.data.jpa.repository.support.JpaEntityInformation<E,​?> entityInformation
      The JpaEntityInformation.
      protected javax.persistence.EntityManager entityManager
      The EntityManager instance.
    • 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
      void forceIncrementModificationCounter​(E entity)  
      Class<E> getEntityClass()  
      E newDslAlias()
      Attention: Please read documentation of QueryDslSupport before usage.
      com.querydsl.jpa.impl.JPADeleteClause newDslDeleteClause​(com.querydsl.core.types.EntityPath<E> entityPath)
      Attention: Please read documentation of QueryDslSupport before usage.
      com.querydsl.jpa.impl.JPADeleteClause newDslDeleteClause​(E alias)
      Attention: Please read documentation of QueryDslSupport before usage.
      com.querydsl.jpa.impl.JPAQuery<E> newDslQuery()
      Attention: Please read documentation of QueryDslSupport before usage.
      com.querydsl.jpa.impl.JPAQuery<E> newDslQuery​(E alias)
      Attention: Please read documentation of QueryDslSupport before 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 interface org.springframework.data.repository.CrudRepository

        count, delete, deleteAll, deleteAll, deleteById, existsById, findById, save
      • Methods inherited from interface org.springframework.data.jpa.repository.JpaRepository

        deleteAllInBatch, deleteInBatch, findAll, findAll, findAll, findAll, findAllById, flush, getOne, saveAll, saveAndFlush
      • Methods inherited from interface org.springframework.data.repository.PagingAndSortingRepository

        findAll
      • Methods inherited from interface org.springframework.data.repository.query.QueryByExampleExecutor

        count, exists, findAll, findOne
    • Field Detail

      • entityManager

        protected final javax.persistence.EntityManager entityManager
        The EntityManager instance.
      • entityInformation

        protected final org.springframework.data.jpa.repository.support.JpaEntityInformation<E,​?> entityInformation
        The JpaEntityInformation.
    • Constructor Detail

      • GenericRepositoryImpl

        public GenericRepositoryImpl​(org.springframework.data.jpa.repository.support.JpaEntityInformation<E,​ID> entityInformation,
                                     javax.persistence.EntityManager entityManager)
        The constructor.
        Parameters:
        entityInformation - the JpaEntityInformation.
        entityManager - the JPA EntityManager.