use of org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean in project crnk-framework by crnk-project.
the class JpaTestConfig method getLocalContainerEntityManagerFactoryBean.
@Bean
public LocalContainerEntityManagerFactoryBean getLocalContainerEntityManagerFactoryBean() {
LocalContainerEntityManagerFactoryBean bean = new LocalContainerEntityManagerFactoryBean();
bean.setJpaProperties(hibernateProperties());
bean.setPackagesToScan(TestEntity.class.getPackage().getName());
bean.setDataSource(testDataSource());
bean.setPersistenceUnitName("TEST");
return bean;
}
use of org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean in project tutorials by eugenp.
the class HibernateSearchConfig method entityManagerFactory.
@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
LocalContainerEntityManagerFactoryBean em = new LocalContainerEntityManagerFactoryBean();
em.setDataSource(dataSource());
em.setPackagesToScan(new String[] { "com.baeldung.hibernatesearch.model" });
JpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();
em.setJpaVendorAdapter(vendorAdapter);
em.setJpaProperties(additionalProperties());
return em;
}
use of org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean in project tutorials by eugenp.
the class PersistenceDerbyJPAConfig method myEmf.
// beans
@Bean
public LocalContainerEntityManagerFactoryBean myEmf() {
final LocalContainerEntityManagerFactoryBean em = new LocalContainerEntityManagerFactoryBean();
em.setDataSource(dataSource());
em.setPackagesToScan(new String[] { "org.baeldung.persistence.model" });
final HibernateJpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();
em.setJpaVendorAdapter(vendorAdapter);
em.setJpaProperties(additionalProperties());
return em;
}
use of org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean in project tutorials by eugenp.
the class PersistenceJPAConfig method entityManagerFactory.
// beans
@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
final LocalContainerEntityManagerFactoryBean em = new LocalContainerEntityManagerFactoryBean();
em.setDataSource(dataSource());
em.setPackagesToScan(new String[] { "org.baeldung.persistence.model" });
final HibernateJpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();
em.setJpaVendorAdapter(vendorAdapter);
em.setJpaProperties(additionalProperties());
return em;
}
use of org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean in project tutorials by eugenp.
the class StudentJPAH2Config method entityManagerFactory.
@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
final LocalContainerEntityManagerFactoryBean em = new LocalContainerEntityManagerFactoryBean();
em.setDataSource(dataSource());
em.setPackagesToScan(new String[] { "org.baeldung.inmemory.persistence.model" });
em.setJpaVendorAdapter(new HibernateJpaVendorAdapter());
em.setJpaProperties(additionalProperties());
return em;
}
Aggregations