@Configuration @EnableConfigurationProperties(value=JpaProperties.class) @Import(value=org.springframework.boot.autoconfigure.orm.jpa.DataSourceInitializedPublisher.Registrar.class) public abstract class JpaBaseConfiguration extends Object implements org.springframework.beans.factory.BeanFactoryAware
Auto-configuration
for JPA.Modifier and Type | Class and Description |
---|---|
protected static class |
JpaBaseConfiguration.JpaWebConfiguration |
Modifier | Constructor and Description |
---|---|
protected |
JpaBaseConfiguration(DataSource dataSource,
JpaProperties properties,
org.springframework.beans.factory.ObjectProvider<org.springframework.transaction.jta.JtaTransactionManager> jtaTransactionManager,
org.springframework.beans.factory.ObjectProvider<TransactionManagerCustomizers> transactionManagerCustomizers) |
Modifier and Type | Method and Description |
---|---|
protected abstract org.springframework.orm.jpa.vendor.AbstractJpaVendorAdapter |
createJpaVendorAdapter() |
protected void |
customizeVendorProperties(Map<String,Object> vendorProperties)
Customize vendor properties before they are used.
|
org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean |
entityManagerFactory(EntityManagerFactoryBuilder factoryBuilder) |
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) |
protected DataSource |
getDataSource()
Return the
DataSource . |
protected org.springframework.transaction.jta.JtaTransactionManager |
getJtaTransactionManager()
Return the JTA transaction manager.
|
protected String[] |
getPackagesToScan() |
protected JpaProperties |
getProperties()
Return the
JpaProperties . |
protected abstract Map<String,Object> |
getVendorProperties() |
protected boolean |
isJta()
Returns if a JTA
PlatformTransactionManager is being used. |
org.springframework.orm.jpa.JpaVendorAdapter |
jpaVendorAdapter() |
void |
setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) |
org.springframework.transaction.PlatformTransactionManager |
transactionManager() |
protected JpaBaseConfiguration(DataSource dataSource, JpaProperties properties, org.springframework.beans.factory.ObjectProvider<org.springframework.transaction.jta.JtaTransactionManager> jtaTransactionManager, org.springframework.beans.factory.ObjectProvider<TransactionManagerCustomizers> transactionManagerCustomizers)
@Bean @ConditionalOnMissingBean public org.springframework.transaction.PlatformTransactionManager transactionManager()
@Bean @ConditionalOnMissingBean public org.springframework.orm.jpa.JpaVendorAdapter jpaVendorAdapter()
@Bean @ConditionalOnMissingBean public 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)
@Bean @Primary @ConditionalOnMissingBean(value={org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.class,javax.persistence.EntityManagerFactory.class}) public org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean entityManagerFactory(EntityManagerFactoryBuilder factoryBuilder)
protected abstract org.springframework.orm.jpa.vendor.AbstractJpaVendorAdapter createJpaVendorAdapter()
protected void customizeVendorProperties(Map<String,Object> vendorProperties)
vendorProperties
- the vendor properties to customizeprotected String[] getPackagesToScan()
protected org.springframework.transaction.jta.JtaTransactionManager getJtaTransactionManager()
null
protected final boolean isJta()
PlatformTransactionManager
is being used.protected final JpaProperties getProperties()
JpaProperties
.protected final DataSource getDataSource()
DataSource
.public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) throws org.springframework.beans.BeansException
setBeanFactory
in interface org.springframework.beans.factory.BeanFactoryAware
org.springframework.beans.BeansException
Copyright © 2020 Pivotal Software, Inc.. All rights reserved.