Example usage for org.springframework.boot.orm.jpa EntityManagerFactoryBuilder EntityManagerFactoryBuilder

List of usage examples for org.springframework.boot.orm.jpa EntityManagerFactoryBuilder EntityManagerFactoryBuilder

Introduction

In this page you can find the example usage for org.springframework.boot.orm.jpa EntityManagerFactoryBuilder EntityManagerFactoryBuilder.

Prototype

public EntityManagerFactoryBuilder(JpaVendorAdapter jpaVendorAdapter, Map<String, ?> jpaProperties,
        PersistenceUnitManager persistenceUnitManager) 

Source Link

Document

Create a new instance passing in the common pieces that will be shared if multiple EntityManagerFactory instances are created.

Usage

From source file:org.springframework.boot.autoconfigure.orm.jpa.JpaBaseConfiguration.java

@Bean
@ConditionalOnMissingBean//from  w w w . ja  va2s  .co  m
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;
}