EntityManagerFactoryBuilder

Convenient builder for JPA EntityManagerFactory instances. Collects common configuration when constructed and then allows you to create one or more LocalContainerEntityManagerFactoryBean 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.

Author

Dave Syer

Phillip Webb

Stephane Nicoll

Since

1.3.0

Constructors

Link copied to clipboard
constructor(jpaVendorAdapter: JpaVendorAdapter, jpaPropertiesFactory: (DataSource) -> Map<String, out Any>, persistenceUnitManager: PersistenceUnitManager)
Create a new instance passing in the common pieces that will be shared if multiple EntityManagerFactory instances are created.
constructor(jpaVendorAdapter: JpaVendorAdapter, jpaPropertiesFactory: (DataSource) -> Map<String, out Any>, persistenceUnitManager: PersistenceUnitManager, persistenceUnitRootLocation: URL)
Create a new instance passing in the common pieces that will be shared if multiple EntityManagerFactory instances are created.
constructor(jpaVendorAdapter: JpaVendorAdapter, jpaProperties: Map<String, out Any>, persistenceUnitManager: PersistenceUnitManager)
Create a new instance passing in the common pieces that will be shared if multiple EntityManagerFactory instances are created.
constructor(jpaVendorAdapter: JpaVendorAdapter, jpaProperties: Map<String, out Any>, persistenceUnitManager: PersistenceUnitManager, persistenceUnitRootLocation: URL)
Create a new instance passing in the common pieces that will be shared if multiple EntityManagerFactory instances are created.

Types

Link copied to clipboard
inner class Builder
A fluent builder for a LocalContainerEntityManagerFactoryBean.

Functions

Link copied to clipboard
Create a new Builder for a EntityManagerFactory using the settings of the given instance, and the given DataSource.
Link copied to clipboard
open fun setBootstrapExecutor(bootstrapExecutor: AsyncTaskExecutor)
Configure the bootstrap executor to be used by the LocalContainerEntityManagerFactoryBean.
Link copied to clipboard
open fun setPersistenceUnitPostProcessors(persistenceUnitPostProcessors: Array<PersistenceUnitPostProcessor>)
Set the persistence unit post processors to be applied to the PersistenceUnitInfo used for creating the LocalContainerEntityManagerFactoryBean.