Example usage for org.springframework.orm.jpa LocalEntityManagerFactoryBean LocalEntityManagerFactoryBean

List of usage examples for org.springframework.orm.jpa LocalEntityManagerFactoryBean LocalEntityManagerFactoryBean

Introduction

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

Prototype

LocalEntityManagerFactoryBean

Source Link

Usage

From source file:spring.jpa.config.DbServiceConfig.java

@Bean
public LocalEntityManagerFactoryBean emfBean() {
    LocalEntityManagerFactoryBean e = new LocalEntityManagerFactoryBean();
    e.setPersistenceUnitName("com.cbs.homeworks.dobri_DB_PU");

    return e;//from   w  ww.j  a  v  a  2 s  .  c  o m
}

From source file:com.otterca.persistence.dao.H2Configuration.java

/**
 * Get entity manager for PostgreSQL database.
 * //from  w ww  .jav a 2 s. c  om
 * @return
 */
@Bean
public LocalEntityManagerFactoryBean getEntityManagerFactory() {
    if (factory == null) {
        synchronized (this) {
            if (factory == null) {
                factory = new LocalEntityManagerFactoryBean();
                factory.setPersistenceUnitName(bundle.getString("persistenceUnitName"));
                factory.setJpaPropertyMap(JpaPropertyMap);
            }
        }
    }
    return factory;
}

From source file:com.otterca.persistence.dao.PostgreSqlConfiguration.java

/**
 * Get entity manager for PostgreSQL database.
 * /*  w w w.jav  a  2  s.c  om*/
 * @return
 */
@Bean
public LocalEntityManagerFactoryBean getEntityManagerFactory() {
    if (factory == null) {
        synchronized (this) {
            if (factory == null) {
                factory = new LocalEntityManagerFactoryBean();
                factory.setPersistenceUnitName(bundle.getString("persistenceUnitName"));
                factory.setJpaPropertyMap(jpaPropertyMap);
            }
        }
    }
    return factory;
}