use of org.springframework.orm.jpa.JpaVendorAdapter 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.JpaVendorAdapter in project invesdwin-context-persistence by subes.
the class PersistenceUnitContext method createEntityManagerFactory.
private EntityManagerFactory createEntityManagerFactory() {
Assertions.assertThat(persistenceUnitContextManager.isValidPersistenceUnit(persistenceUnitName)).as("Not a valid persistence unit: %s", persistenceUnitName).isTrue();
final LocalContainerEntityManagerFactoryBean factory = new LocalContainerEntityManagerFactoryBean();
factory.setPersistenceUnitManager(persistenceUnitManager);
factory.setPersistenceUnitName(persistenceUnitName);
final JpaVendorAdapter jpaVendorAdapter = getJpaVendorAdapter();
if (jpaVendorAdapter != null) {
factory.setJpaVendorAdapter(jpaVendorAdapter);
} else {
factory.setPersistenceProvider(getPersistenceProvider());
}
final JpaDialect jpaDialect = getJpaDialect();
if (jpaDialect != null) {
factory.setJpaDialect(jpaDialect);
}
factory.afterPropertiesSet();
final String entityManagerFactoryBeanName = getPersistenceUnitName() + PersistenceProperties.ENTITY_MANAGER_FACTORY_NAME_SUFFIX;
MergedContext.getInstance().registerBean(entityManagerFactoryBeanName, factory);
Assertions.assertThat(MergedContext.getInstance().getBean(entityManagerFactoryBeanName)).isNotNull();
return factory.getObject();
}
use of org.springframework.orm.jpa.JpaVendorAdapter in project bundle-app-ui by astrapi69.
the class PersistenceJPAConfig method entityManagerFactory.
@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
// final LocalContainerEntityManagerFactoryBean em = SpringJpaFactory
// .newEntityManagerFactoryBean("bundlemanagement", dataSource(),
// SpringJpaFactory.newJpaVendorAdapter(Database.H2), jpaProperties());
LocalContainerEntityManagerFactoryBean em = new LocalContainerEntityManagerFactoryBean();
em.setPersistenceUnitName("bundlemanagement");
em.setDataSource(dataSource());
em.setPackagesToScan(new String[] { "de.alpharogroup.db.resource.bundles.*", "de.alpharogroup.db.resource.bundles.*.*", "de.alpharogroup.address.book.*", "de.alpharogroup.address.book.*.*", "de.alpharogroup.resource.system.*", "de.alpharogroup.resource.system.*.*", "de.alpharogroup.user.*", "de.alpharogroup.user.*.*", "de.alpharogroup.user.management.*", "de.alpharogroup.user.management.*.*" });
JpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();
em.setJpaVendorAdapter(vendorAdapter);
em.setJpaProperties(jpaProperties());
return em;
}
use of org.springframework.orm.jpa.JpaVendorAdapter in project tutorials by eugenp.
the class PersistenceConfig method entityManagerFactory.
@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
final LocalContainerEntityManagerFactoryBean emf = new LocalContainerEntityManagerFactoryBean();
emf.setDataSource(restDataSource());
emf.setPackagesToScan(new String[] { "com.baeldung.persistence.model" });
final JpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();
emf.setJpaVendorAdapter(vendorAdapter);
emf.setJpaProperties(hibernateProperties());
return emf;
}
use of org.springframework.orm.jpa.JpaVendorAdapter in project survey by markoniemi.
the class JpaConfig method entityManagerFactory.
@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
LocalContainerEntityManagerFactoryBean em = new LocalContainerEntityManagerFactoryBean();
em.setDataSource(dataSource());
JpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();
em.setJpaVendorAdapter(vendorAdapter);
em.setJpaProperties(additionalProperties());
// em.setPackagesToScan("package.where.your.entites.like.CustSys.are.stored");
return em;
}
Aggregations