Package org.springframework.orm.jpa

Examples of org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean


    }

    // Entity Manager Factory
    @Bean
    public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
        LocalContainerEntityManagerFactoryBean entityManagerFactory = new LocalContainerEntityManagerFactoryBean();
        entityManagerFactory.setDataSource(dataSource);
        entityManagerFactory.setJpaVendorAdapter(jpaVendorAdapter);
        entityManagerFactory.setJpaProperties(persistenceXmlProperties());
        entityManagerFactory.setPackagesToScan("org.andidev.applicationname.entity");

        return entityManagerFactory;
    }
View Full Code Here


    HibernateJpaVendorAdapter adapter = new HibernateJpaVendorAdapter();
    adapter.setDatabase(Database.HSQL);
    adapter.setGenerateDdl(true);

    LocalContainerEntityManagerFactoryBean factoryBean = new LocalContainerEntityManagerFactoryBean();
    factoryBean.setPackagesToScan(getClass().getPackage().getName());
    factoryBean.setMappingResources("META-INF/orm.xml");
    factoryBean.setJpaVendorAdapter(adapter);
    factoryBean.setDataSource(dataSource);

    return factoryBean;
  }
View Full Code Here

TOP

Related Classes of org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.