Class ApplicationJpaConfiguration


  • @Configuration
    @ConditionalOnClass(name={"org.springframework.orm.jpa.JpaVendorAdapter","org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean","org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter","org.springframework.transaction.PlatformTransactionManager"})
    public class ApplicationJpaConfiguration
    extends Object
    The ApplicationJpaConfiguration class initialises the JPA EntityManagerFactory for the application.
    Author:
    Marcus Portmann
    • Method Detail

      • applicationEntityManagerFactory

        @Bean
        @Primary
        @ConditionalOnBean(name="applicationDataSource",
                           value=javax.sql.DataSource.class)
        public org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean applicationEntityManagerFactory​(@Qualifier("applicationDataSource")
                                                                                                                  DataSource dataSource,
                                                                                                                  org.springframework.transaction.PlatformTransactionManager platformTransactionManager)
        Returns the application entity manager factory bean associated with the application data source.
        Parameters:
        dataSource - the application data source
        platformTransactionManager - the platform transaction manager
        Returns:
        the application entity manager factory bean associated with the application data source
      • packagesToScanForEntities

        protected List<String> packagesToScanForEntities()
        Returns the names of the packages to scan for JPA entity classes.
        Returns:
        the names of the packages to scan for JPA entity classes