类 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.- 从以下版本开始:
- 1.0.0
- 作者:
- Phillip Webb, Dave Syer, Oliver Gierke, Andy Wilkinson, Kazuki Shimizu, Eddú Meléndez, Yanming Zhou
-
嵌套类概要
嵌套类 -
构造器概要
构造器限定符构造器说明protected
JpaBaseConfiguration
(DataSource dataSource, JpaProperties properties, ObjectProvider<JtaTransactionManager> jtaTransactionManager) -
方法概要
修饰符和类型方法说明protected abstract AbstractJpaVendorAdapter
protected void
customizeVendorProperties
(Map<String, Object> vendorProperties) Customize vendor properties before they are used.entityManagerFactory
(EntityManagerFactoryBuilder factoryBuilder, PersistenceManagedTypes persistenceManagedTypes) entityManagerFactoryBuilder
(JpaVendorAdapter jpaVendorAdapter, ObjectProvider<PersistenceUnitManager> persistenceUnitManager, ObjectProvider<EntityManagerFactoryBuilderCustomizer> customizers) protected final DataSource
Return theDataSource
.protected JtaTransactionManager
Return the JTA transaction manager.protected final JpaProperties
Return theJpaProperties
.已过时, 待删除: 此 API 元素将从以后的版本中删除。getVendorProperties
(DataSource dataSource) Return the vendor-specific properties for the givenDataSource
.protected final boolean
isJta()
Returns if a JTAPlatformTransactionManager
is being used.transactionManager
(ObjectProvider<TransactionManagerCustomizers> transactionManagerCustomizers)
-
构造器详细资料
-
JpaBaseConfiguration
protected JpaBaseConfiguration(DataSource dataSource, JpaProperties properties, ObjectProvider<JtaTransactionManager> jtaTransactionManager)
-
-
方法详细资料
-
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
@Bean @Primary @ConditionalOnMissingBean({org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.class,jakarta.persistence.EntityManagerFactory.class}) public LocalContainerEntityManagerFactoryBean entityManagerFactory(EntityManagerFactoryBuilder factoryBuilder, PersistenceManagedTypes persistenceManagedTypes) -
createJpaVendorAdapter
-
getVendorProperties
Return the vendor-specific properties for the givenDataSource
.- 参数:
dataSource
- the data source- 返回:
- the vendor properties
- 从以下版本开始:
- 3.4.4
-
getVendorProperties
已过时, 待删除: 此 API 元素将从以后的版本中删除。since 3.4.4 for removal in 4.0.0 in favor ofgetVendorProperties(DataSource)
Return the vendor-specific properties.- 返回:
- the vendor properties
-
customizeVendorProperties
Customize vendor properties before they are used. Allows for post-processing (for example to configure JTA specific settings).- 参数:
vendorProperties
- the vendor properties to customize
-
getJtaTransactionManager
Return the JTA transaction manager.- 返回:
- the transaction manager or
null
-
isJta
protected final boolean isJta()Returns if a JTAPlatformTransactionManager
is being used.- 返回:
- if a JTA transaction manager is being used
-
getProperties
Return theJpaProperties
.- 返回:
- the properties
-
getDataSource
Return theDataSource
.- 返回:
- the data source
-
getVendorProperties(DataSource)