类 EntityManagerFactoryBuilder
- java.lang.Object
- org.springframework.boot.orm.jpa.EntityManagerFactoryBuilder
public class EntityManagerFactoryBuilder extends Object
Convenient builder for JPA EntityManagerFactory instances. Collects common configuration when constructed and then allows you to create one or moreLocalContainerEntityManagerFactoryBean
through a fluent builder pattern. The most common options are covered in the builder, but you can always manipulate the product of the builder if you need more control, before returning it from a@Bean
definition.- 从以下版本开始:
- 1.3.0
嵌套类概要
嵌套类 修饰符和类型 类 说明 class
EntityManagerFactoryBuilder.Builder
A fluent builder for a LocalContainerEntityManagerFactoryBean.
构造器概要
构造器 构造器 说明 EntityManagerFactoryBuilder(org.springframework.orm.jpa.JpaVendorAdapter jpaVendorAdapter, Map<String,?> jpaProperties, org.springframework.orm.jpa.persistenceunit.PersistenceUnitManager persistenceUnitManager)
Create a new instance passing in the common pieces that will be shared if multiple EntityManagerFactory instances are created.EntityManagerFactoryBuilder(org.springframework.orm.jpa.JpaVendorAdapter jpaVendorAdapter, Map<String,?> jpaProperties, org.springframework.orm.jpa.persistenceunit.PersistenceUnitManager persistenceUnitManager, URL persistenceUnitRootLocation)
Create a new instance passing in the common pieces that will be shared if multiple EntityManagerFactory instances are created.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 EntityManagerFactoryBuilder.Builder
dataSource(DataSource dataSource)
void
setBootstrapExecutor(org.springframework.core.task.AsyncTaskExecutor bootstrapExecutor)
Configure the bootstrap executor to be used by theLocalContainerEntityManagerFactoryBean
.
构造器详细资料
EntityManagerFactoryBuilder
public EntityManagerFactoryBuilder(org.springframework.orm.jpa.JpaVendorAdapter jpaVendorAdapter, Map<String,?> jpaProperties, org.springframework.orm.jpa.persistenceunit.PersistenceUnitManager persistenceUnitManager)
Create a new instance passing in the common pieces that will be shared if multiple EntityManagerFactory instances are created.- 参数:
jpaVendorAdapter
- a vendor adapterjpaProperties
- the JPA properties to be passed to the persistence providerpersistenceUnitManager
- optional source of persistence unit information (can be null)
EntityManagerFactoryBuilder
public EntityManagerFactoryBuilder(org.springframework.orm.jpa.JpaVendorAdapter jpaVendorAdapter, Map<String,?> jpaProperties, org.springframework.orm.jpa.persistenceunit.PersistenceUnitManager persistenceUnitManager, URL persistenceUnitRootLocation)
Create a new instance passing in the common pieces that will be shared if multiple EntityManagerFactory instances are created.- 参数:
jpaVendorAdapter
- a vendor adapterjpaProperties
- the JPA properties to be passed to the persistence providerpersistenceUnitManager
- optional source of persistence unit information (can be null)persistenceUnitRootLocation
- the persistence unit root location to use as a fallback (can be null)- 从以下版本开始:
- 1.4.1
方法详细资料
dataSource
public EntityManagerFactoryBuilder.Builder dataSource(DataSource dataSource)
setBootstrapExecutor
public void setBootstrapExecutor(org.springframework.core.task.AsyncTaskExecutor bootstrapExecutor)
Configure the bootstrap executor to be used by theLocalContainerEntityManagerFactoryBean
.- 参数:
bootstrapExecutor
- the executor- 从以下版本开始:
- 2.1.0