Class GenericRepositoryFactoryBean<R extends GenericRepository<E,​ID>,​E,​ID extends Serializable>

  • Type Parameters:
    R - generic type of the GenericRepository interface.
    E - generic type of the managed entity.
    ID - generic type of the primary key of the entity.
    All Implemented Interfaces:
    org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.FactoryBean<R>, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationEventPublisherAware, org.springframework.data.repository.core.support.RepositoryFactoryInformation<E,​ID>

    public class GenericRepositoryFactoryBean<R extends GenericRepository<E,​ID>,​E,​ID extends Serializable>
    extends org.springframework.data.jpa.repository.support.JpaRepositoryFactoryBean<R,​E,​ID>
    RepositoryFactoryBeanSupport for GenericRepositoryImpl. In order to use GenericRepository you need to annotate your spring-boot application as following:
     @EnableJpaRepositories(repositoryFactoryBeanClass = GenericRepositoryFactoryBean.class)
     
    Since:
    3.0.0
    • Constructor Summary

      Constructors 
      Constructor Description
      GenericRepositoryFactoryBean​(Class<? extends R> repositoryInterface)
      Creates a new JpaRepositoryFactoryBean for the given repository interface.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected org.springframework.data.repository.core.support.RepositoryFactorySupport createRepositoryFactory​(javax.persistence.EntityManager entityManager)  
      • Methods inherited from class org.springframework.data.jpa.repository.support.JpaRepositoryFactoryBean

        afterPropertiesSet, doCreateRepositoryFactory, setEntityManager, setEntityPathResolver, setEscapeCharacter, setMappingContext
      • Methods inherited from class org.springframework.data.repository.core.support.TransactionalRepositoryFactoryBeanSupport

        createRepositoryFactory, setBeanFactory, setEnableDefaultTransactions, setTransactionManager
      • Methods inherited from class org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport

        getEntityInformation, getObject, getObjectType, getPersistentEntity, getQueryMethods, getRepositoryInformation, isSingleton, setApplicationEventPublisher, setBeanClassLoader, setCustomImplementation, setEvaluationContextProvider, setLazyInit, setNamedQueries, setQueryLookupStrategyKey, setRepositoryBaseClass, setRepositoryFragments
    • Constructor Detail

      • GenericRepositoryFactoryBean

        public GenericRepositoryFactoryBean​(Class<? extends R> repositoryInterface)
        Creates a new JpaRepositoryFactoryBean for the given repository interface.
        Parameters:
        repositoryInterface - must not be null.
    • Method Detail

      • createRepositoryFactory

        protected org.springframework.data.repository.core.support.RepositoryFactorySupport createRepositoryFactory​(javax.persistence.EntityManager entityManager)
        Overrides:
        createRepositoryFactory in class org.springframework.data.jpa.repository.support.JpaRepositoryFactoryBean<R extends GenericRepository<E,​ID>,​E,​ID extends Serializable>