use of org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean in project uhgroupings by uhawaii-system-its-ti-iam.
the class DatabaseConfig method entityManagerFactory.
@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
LocalContainerEntityManagerFactoryBean em = new LocalContainerEntityManagerFactoryBean();
em.setPersistenceUnitName("holidayPersistenceUnit");
em.setPersistenceProviderClass(HibernatePersistenceProvider.class);
em.setPackagesToScan("edu.hawaii.its.groupings.type", "edu.hawaii.its.api.type");
em.setJpaVendorAdapter(new HibernateJpaVendorAdapter());
em.setJpaProperties(jpaProperties());
em.setDataSource(dataSource());
return em;
}
use of org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean in project av-service by dvoraka.
the class DbMemConfig method entityManagerFactory.
@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory(DataSource dataSource) {
LocalContainerEntityManagerFactoryBean entityManagerFactoryBean = new LocalContainerEntityManagerFactoryBean();
entityManagerFactoryBean.setDataSource(dataSource);
entityManagerFactoryBean.setJpaVendorAdapter(new HibernateJpaVendorAdapter());
entityManagerFactoryBean.setPackagesToScan("dvoraka.avservice.db.model");
entityManagerFactoryBean.setJpaProperties(hibernateProperties());
return entityManagerFactoryBean;
}
use of org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean in project Logos_Materials_October_2017 by VolodymyrZavada.
the class DatabaseConfig method getEntityManagerFactory.
@Bean(name = "entityManagerFactory")
public LocalContainerEntityManagerFactoryBean getEntityManagerFactory() throws PropertyVetoException {
LocalContainerEntityManagerFactoryBean emf = new LocalContainerEntityManagerFactoryBean();
emf.setDataSource(getDataSource());
emf.setPackagesToScan(new String[] { "ua.online.courses.entity" });
emf.setPersistenceUnitName("spring-jpa-unit");
emf.setJpaVendorAdapter(getHibernateAdapter());
Properties jpaProperties = new Properties();
jpaProperties.put("hibernate.dialect", env.getProperty("spring.jpa.properties.hibernate.dialect"));
jpaProperties.put("hibernate.hbm2ddl.auto", env.getProperty("spring.jpa.hibernate.ddl-auto"));
jpaProperties.put("hibernate.show_sql", env.getProperty("spring.jpa.show-sql"));
jpaProperties.put("hibernate.format_sql", env.getProperty("spring.jpa.format_sql"));
emf.setJpaProperties(jpaProperties);
return emf;
}
use of org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean in project Logos_Materials_October_2017 by VolodymyrZavada.
the class DatabaseConfig method getEntityManagerFactory.
@Bean(name = "entityManagerFactory")
public LocalContainerEntityManagerFactoryBean getEntityManagerFactory() throws PropertyVetoException {
LocalContainerEntityManagerFactoryBean emf = new LocalContainerEntityManagerFactoryBean();
emf.setDataSource(getDataSource());
emf.setPackagesToScan(new String[] { "ua.spring.web.entity" });
emf.setPersistenceUnitName("spring-jpa-unit");
emf.setJpaVendorAdapter(getHibernateAdapter());
Properties jpaProperties = new Properties();
jpaProperties.put("hibernate.dialect", env.getProperty("spring.jpa.properties.hibernate.dialect"));
jpaProperties.put("hibernate.hbm2ddl.auto", env.getProperty("spring.jpa.hibernate.ddl-auto"));
jpaProperties.put("hibernate.show_sql", env.getProperty("spring.jpa.show-sql"));
jpaProperties.put("hibernate.format_sql", env.getProperty("spring.jpa.format_sql"));
emf.setJpaProperties(jpaProperties);
return emf;
}
use of org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean in project herd by FINRAOS.
the class DaoSpringModuleConfig method entityManagerFactory.
/**
* The JPA entity manager factory.
*
* @return the entity manager factory.
*/
@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
// Create the entity manager factory against our data source.
LocalContainerEntityManagerFactoryBean entityManagerFactory = new LocalContainerEntityManagerFactoryBean();
entityManagerFactory.setDataSource(getHerdDataSource());
// Auto-scan our model classes for persistent objects.
entityManagerFactory.setPackagesToScan(MODEL_PACKAGES_TO_SCAN);
// Set the JPA vendor adapter using a configured Spring bean.
entityManagerFactory.setJpaVendorAdapter(getHibernateJpaVendorAdapter());
// Set JPA additional properties.
entityManagerFactory.setJpaProperties(jpaProperties());
return entityManagerFactory;
}
Aggregations