use of org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter in project spring-security by spring-projects.
the class DataConfiguration method entityManagerFactory.
@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
HibernateJpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();
vendorAdapter.setDatabase(Database.HSQL);
vendorAdapter.setGenerateDdl(true);
LocalContainerEntityManagerFactoryBean factory = new LocalContainerEntityManagerFactoryBean();
factory.setJpaVendorAdapter(vendorAdapter);
factory.setPackagesToScan(Message.class.getPackage().getName());
factory.setDataSource(dataSource());
return factory;
}
use of org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter 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.vendor.HibernateJpaVendorAdapter 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.vendor.HibernateJpaVendorAdapter in project herd by FINRAOS.
the class DaoSpringModuleConfig method getHibernateJpaVendorAdapter.
/**
* Gets the Hibernate JPA vendor adapter needed by the entity manager.
*
* @return the Hibernate JPA vendor adapter.
*/
private JpaVendorAdapter getHibernateJpaVendorAdapter() {
HibernateJpaVendorAdapter hibernateJpaVendorAdapter = new HibernateJpaVendorAdapter();
// Set the database type.
String databaseType = configurationHelper.getProperty(ConfigurationValue.DATABASE_TYPE);
if (StringUtils.isBlank(databaseType)) {
throw new IllegalStateException(String.format("No database type found. Ensure the \"%s\" configuration entry is configured.", ConfigurationValue.DATABASE_TYPE.getKey()));
}
Database database = Database.valueOf(databaseType);
LOGGER.info("jpaTargetDatabase={}", database);
hibernateJpaVendorAdapter.setDatabase(database);
hibernateJpaVendorAdapter.setGenerateDdl(false);
return hibernateJpaVendorAdapter;
}
use of org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter 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;
}
Aggregations