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

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

Introduction

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

Prototype

LocalContainerEntityManagerFactoryBean

Source Link

Usage

From source file:com.digitalgeneralists.assurance.model.HibernateConfiguration.java

@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
    Properties props = this.hibernateProperties();

    LocalContainerEntityManagerFactoryBean em = new LocalContainerEntityManagerFactoryBean();
    em.setPersistenceUnitName("assurancePersistenceUnit");
    em.setDataSource(this.dataSource);
    em.setPackagesToScan(new String[] { "com.digitalgeneralists.assurance.model.entities" });

    JpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();
    em.setJpaVendorAdapter(vendorAdapter);
    vendorAdapter = null;/*from w  w w  .  j  a v  a2 s . co m*/
    em.setJpaProperties(props);
    props = null;

    return em;
}

From source file:br.com.joaops.smt.configuration.PersistenceConfig.java

@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
    LocalContainerEntityManagerFactoryBean em = new LocalContainerEntityManagerFactoryBean();
    em.setPackagesToScan(this.getPackagesToScan());
    JpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();
    em.setJpaVendorAdapter(vendorAdapter);
    em.setJpaProperties(getAdditionalProperties());
    return em;/*w  w  w. j  a v a 2 s . c o m*/
}

From source file:com.wesleymartins.tp2domainmodelweb.app.config.ConnectionConfig.java

@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory(DataSource dataSource,
        JpaVendorAdapter jpaVendorAdapter) {
    LocalContainerEntityManagerFactoryBean lef = new LocalContainerEntityManagerFactoryBean();
    lef.setDataSource(dataSource);//from   www  .  ja v a  2s .c  om
    lef.setJpaVendorAdapter(jpaVendorAdapter);
    lef.setPackagesToScan("com.wesleymartins.tp2domainmodelweb.domain");
    return lef;
}

From source file:tp.project.trafficviolationsystem.app.conf.ConnectionConfig.java

@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory(DataSource dataSource,
        JpaVendorAdapter jpaVendorAdapter) {
    LocalContainerEntityManagerFactoryBean lef = new LocalContainerEntityManagerFactoryBean();
    lef.setDataSource(dataSource);/* w  w  w  .j  av  a2s .c o  m*/
    lef.setJpaVendorAdapter(jpaVendorAdapter);
    lef.setPackagesToScan("tp.project.trafficviolationsystem.domain");
    return lef;
}

From source file:org.spring.data.jpa.sample.interceptors.InfrastructureConfiguration.java

@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory() {

    HibernateJpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();
    vendorAdapter.setDatabase(Database.HSQL);
    vendorAdapter.setGenerateDdl(true);//from   www .ja  v  a  2 s  .com

    LocalContainerEntityManagerFactoryBean factory = new LocalContainerEntityManagerFactoryBean();
    factory.setJpaVendorAdapter(vendorAdapter);
    factory.setPackagesToScan(getClass().getPackage().getName());
    factory.setDataSource(dataSource());

    return factory;
}

From source file:com.nyaba.dvdrentalsystem.app.config.ConnectionConfig.java

@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory(DataSource dataSource,
        JpaVendorAdapter jpaVendorAdapter) {
    LocalContainerEntityManagerFactoryBean lef = new LocalContainerEntityManagerFactoryBean();
    lef.setDataSource(dataSource);/*from  w  ww. j  a  v a 2 s.  com*/
    lef.setJpaVendorAdapter(jpaVendorAdapter);
    lef.setPackagesToScan("com.nyaba.dvdrentalsystem.domain");
    return lef;
}

From source file:com.mycompany.cputauctionnew.app.config.ConnectionConfig.java

@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory(DataSource dataSource,
        JpaVendorAdapter jpaVendorAdapter) {
    LocalContainerEntityManagerFactoryBean lef = new LocalContainerEntityManagerFactoryBean();
    lef.setDataSource(dataSource);//from   w  w w. j  a v  a 2s  .c o m
    lef.setJpaVendorAdapter(jpaVendorAdapter);
    lef.setPackagesToScan("com.mycompany.cputauctionnew.domain");
    return lef;
}

From source file:com.ipet.server.config.JPAConfiguration.java

@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory(DataSource dataSource,
        JpaVendorAdapter jpaVendorAdapter) {
    LocalContainerEntityManagerFactoryBean lef = new LocalContainerEntityManagerFactoryBean();
    lef.setPersistenceUnitName("default");
    lef.setPackagesToScan("com.ipet.server");
    lef.setDataSource(dataSource);/*from w ww. j  a  va 2 s  . c om*/
    lef.setJpaVendorAdapter(jpaVendorAdapter);
    lef.setJpaProperties(getJpaProperties());
    //return lef;
    return null;
}

From source file:com.navita.mavenproject4.config.JpaConfig.java

@Bean
public EntityManagerFactory entityManagerFactory() {

    HibernateJpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();
    vendorAdapter.setGenerateDdl(true);//www  .ja  va2  s. co m

    LocalContainerEntityManagerFactoryBean factory = new LocalContainerEntityManagerFactoryBean();
    factory.setJpaVendorAdapter(vendorAdapter);
    factory.setPackagesToScan("com.navita.mavenproject4.entity");
    factory.setDataSource((javax.sql.DataSource) dataSource());
    factory.afterPropertiesSet();

    return factory.getObject();
}

From source file:com.nkosy.propertymanager.app.ConnectionConfig.java

/**
 *
 * @param dataSource//from  w w  w .  jav  a 2s.  com
 * @param jpaVendorAdapter
 * @return
 */
@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory(DataSource dataSource,
        JpaVendorAdapter jpaVendorAdapter) {
    LocalContainerEntityManagerFactoryBean lef = new LocalContainerEntityManagerFactoryBean();
    lef.setDataSource(dataSource);
    lef.setJpaVendorAdapter(jpaVendorAdapter);
    lef.setPackagesToScan("com.nkosy.propertymanager.domain");
    return lef;
}