Class JpaBaseConfiguration
java.lang.Object
org.springframework.boot.autoconfigure.orm.jpa.JpaBaseConfiguration
- All Implemented Interfaces:
Aware
,BeanFactoryAware
@Configuration(proxyBeanMethods=false)
@EnableConfigurationProperties(JpaProperties.class)
public abstract class JpaBaseConfiguration
extends Object
implements BeanFactoryAware
Base
Auto-configuration
for JPA.- Since:
- 1.0.0
- Author:
- Phillip Webb, Dave Syer, Oliver Gierke, Andy Wilkinson, Kazuki Shimizu, EddĂș MelĂ©ndez
-
Nested Class Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
JpaBaseConfiguration
(DataSource dataSource, JpaProperties properties, ObjectProvider<JtaTransactionManager> jtaTransactionManager) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract AbstractJpaVendorAdapter
protected void
customizeVendorProperties
(Map<String, Object> vendorProperties) Customize vendor properties before they are used.entityManagerFactory
(EntityManagerFactoryBuilder factoryBuilder) entityManagerFactoryBuilder
(JpaVendorAdapter jpaVendorAdapter, ObjectProvider<PersistenceUnitManager> persistenceUnitManager, ObjectProvider<EntityManagerFactoryBuilderCustomizer> customizers) protected final DataSource
Return theDataSource
.protected JtaTransactionManager
Return the JTA transaction manager.protected String[]
protected final JpaProperties
Return theJpaProperties
.protected final boolean
isJta()
Returns if a JTAPlatformTransactionManager
is being used.void
setBeanFactory
(BeanFactory beanFactory) transactionManager
(ObjectProvider<TransactionManagerCustomizers> transactionManagerCustomizers)
-
Constructor Details
-
JpaBaseConfiguration
protected JpaBaseConfiguration(DataSource dataSource, JpaProperties properties, ObjectProvider<JtaTransactionManager> jtaTransactionManager)
-
-
Method Details
-
transactionManager
@Bean @ConditionalOnMissingBean(org.springframework.transaction.TransactionManager.class) public PlatformTransactionManager transactionManager(ObjectProvider<TransactionManagerCustomizers> transactionManagerCustomizers) -
jpaVendorAdapter
-
entityManagerFactoryBuilder
@Bean @ConditionalOnMissingBean public EntityManagerFactoryBuilder entityManagerFactoryBuilder(JpaVendorAdapter jpaVendorAdapter, ObjectProvider<PersistenceUnitManager> persistenceUnitManager, ObjectProvider<EntityManagerFactoryBuilderCustomizer> customizers) -
entityManagerFactory
-
createJpaVendorAdapter
-
getVendorProperties
-
customizeVendorProperties
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
-
getPackagesToScan
-
getJtaTransactionManager
Return the JTA transaction manager.- Returns:
- the transaction manager or
null
-
isJta
protected final boolean isJta()Returns if a JTAPlatformTransactionManager
is being used.- Returns:
- if a JTA transaction manager is being used
-
getProperties
Return theJpaProperties
.- Returns:
- the properties
-
getDataSource
Return theDataSource
.- Returns:
- the data source
-
setBeanFactory
- Specified by:
setBeanFactory
in interfaceBeanFactoryAware
- Throws:
BeansException
-