Search in sources :

Example 1 with EntityManagerFactoryBuilder

use of org.springframework.boot.orm.jpa.EntityManagerFactoryBuilder in project spring-boot by spring-projects.

the class JpaBaseConfiguration method entityManagerFactoryBuilder.

@Bean
@ConditionalOnMissingBean
public EntityManagerFactoryBuilder entityManagerFactoryBuilder(JpaVendorAdapter jpaVendorAdapter, ObjectProvider<PersistenceUnitManager> persistenceUnitManager) {
    EntityManagerFactoryBuilder builder = new EntityManagerFactoryBuilder(jpaVendorAdapter, this.properties.getProperties(), persistenceUnitManager.getIfAvailable());
    builder.setCallback(getVendorCallback());
    return builder;
}
Also used : EntityManagerFactoryBuilder(org.springframework.boot.orm.jpa.EntityManagerFactoryBuilder) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean) LocalContainerEntityManagerFactoryBean(org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean)

Example 2 with EntityManagerFactoryBuilder

use of org.springframework.boot.orm.jpa.EntityManagerFactoryBuilder in project spring-boot by spring-projects.

the class JpaBaseConfiguration method entityManagerFactoryBuilder.

@Bean
@ConditionalOnMissingBean
public EntityManagerFactoryBuilder entityManagerFactoryBuilder(JpaVendorAdapter jpaVendorAdapter, ObjectProvider<PersistenceUnitManager> persistenceUnitManager, ObjectProvider<EntityManagerFactoryBuilderCustomizer> customizers) {
    EntityManagerFactoryBuilder builder = new EntityManagerFactoryBuilder(jpaVendorAdapter, this.properties.getProperties(), persistenceUnitManager.getIfAvailable());
    customizers.orderedStream().forEach((customizer) -> customizer.customize(builder));
    return builder;
}
Also used : EntityManagerFactoryBuilder(org.springframework.boot.orm.jpa.EntityManagerFactoryBuilder) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) ConditionalOnMissingFilterBean(org.springframework.boot.autoconfigure.web.servlet.ConditionalOnMissingFilterBean) ConditionalOnMissingBean(org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean) Bean(org.springframework.context.annotation.Bean) LocalContainerEntityManagerFactoryBean(org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean)

Aggregations

ConditionalOnMissingBean (org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean)2 EntityManagerFactoryBuilder (org.springframework.boot.orm.jpa.EntityManagerFactoryBuilder)2 Bean (org.springframework.context.annotation.Bean)2 LocalContainerEntityManagerFactoryBean (org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean)2 ConditionalOnMissingFilterBean (org.springframework.boot.autoconfigure.web.servlet.ConditionalOnMissingFilterBean)1