Class JpaBaseConfiguration

java.lang.Object
org.springframework.boot.autoconfigure.orm.jpa.JpaBaseConfiguration

@Configuration(proxyBeanMethods=false) @EnableConfigurationProperties(JpaProperties.class) public abstract class JpaBaseConfiguration extends Object
Base Auto-configuration for JPA.
Since:
1.0.0
  • Constructor Details

    • JpaBaseConfiguration

      protected JpaBaseConfiguration(DataSource dataSource, JpaProperties properties, org.springframework.beans.factory.ObjectProvider<org.springframework.transaction.jta.JtaTransactionManager> jtaTransactionManager)
  • Method Details

    • transactionManager

      @Bean @ConditionalOnMissingBean(org.springframework.transaction.TransactionManager.class) public org.springframework.transaction.PlatformTransactionManager transactionManager(org.springframework.beans.factory.ObjectProvider<TransactionManagerCustomizers> transactionManagerCustomizers)
    • jpaVendorAdapter

      @Bean @ConditionalOnMissingBean public org.springframework.orm.jpa.JpaVendorAdapter jpaVendorAdapter()
    • entityManagerFactoryBuilder

      @Bean @ConditionalOnMissingBean public org.springframework.boot.orm.jpa.EntityManagerFactoryBuilder entityManagerFactoryBuilder(org.springframework.orm.jpa.JpaVendorAdapter jpaVendorAdapter, org.springframework.beans.factory.ObjectProvider<org.springframework.orm.jpa.persistenceunit.PersistenceUnitManager> persistenceUnitManager, org.springframework.beans.factory.ObjectProvider<EntityManagerFactoryBuilderCustomizer> customizers)
    • entityManagerFactory

      @Bean @Primary @ConditionalOnMissingBean({org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.class,jakarta.persistence.EntityManagerFactory.class}) public org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean entityManagerFactory(org.springframework.boot.orm.jpa.EntityManagerFactoryBuilder factoryBuilder, org.springframework.orm.jpa.persistenceunit.PersistenceManagedTypes persistenceManagedTypes)
    • createJpaVendorAdapter

      protected abstract org.springframework.orm.jpa.vendor.AbstractJpaVendorAdapter createJpaVendorAdapter()
    • getVendorProperties

      protected abstract Map<String,Object> getVendorProperties(DataSource dataSource)
      Return the vendor-specific properties for the given DataSource.
      Parameters:
      dataSource - the data source
      Returns:
      the vendor properties
      Since:
      3.4.4
    • getVendorProperties

      @Deprecated(since="3.4.4", forRemoval=true) protected Map<String,Object> getVendorProperties()
      Deprecated, for removal: This API element is subject to removal in a future version.
      since 3.4.4 for removal in 4.0.0 in favor of getVendorProperties(DataSource)
      Return the vendor-specific properties.
      Returns:
      the vendor properties
    • customizeVendorProperties

      protected void customizeVendorProperties(Map<String,Object> vendorProperties)
      Customize vendor properties before they are used. Allows for post-processing (for example to configure JTA specific settings).
      Parameters:
      vendorProperties - the vendor properties to customize
    • getJtaTransactionManager

      protected org.springframework.transaction.jta.JtaTransactionManager getJtaTransactionManager()
      Return the JTA transaction manager.
      Returns:
      the transaction manager or null
    • isJta

      protected final boolean isJta()
      Returns if a JTA PlatformTransactionManager is being used.
      Returns:
      if a JTA transaction manager is being used
    • getProperties

      protected final JpaProperties getProperties()
      Return the JpaProperties.
      Returns:
      the properties
    • getDataSource

      protected final DataSource getDataSource()
      Return the DataSource.
      Returns:
      the data source