use of org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter in project workbench by all-of-us.
the class TestJpaConfig method entityManagerFactory.
@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
final LocalContainerEntityManagerFactoryBean em = new LocalContainerEntityManagerFactoryBean();
em.setDataSource(dataSource());
em.setPackagesToScan(new String[] { "org.pmiops.workbench.cdr", "org.pmiops.workbench.db" });
em.setJpaVendorAdapter(new HibernateJpaVendorAdapter());
em.setJpaProperties(additionalProperties());
return em;
}
use of org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter in project av-service by dvoraka.
the class DbCommonConfig method entityManagerFactory.
@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory(DataSource dataSource, Properties hibernateProperties) {
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 spring-boot by spring-projects.
the class CustomHibernateJpaAutoConfigurationTests method defaultDatabaseIsSet.
@Test
void defaultDatabaseIsSet() {
this.contextRunner.withPropertyValues("spring.datasource.url:jdbc:h2:mem:testdb", "spring.datasource.initialization-mode:never").run((context) -> {
HibernateJpaVendorAdapter bean = context.getBean(HibernateJpaVendorAdapter.class);
Database database = (Database) ReflectionTestUtils.getField(bean, "database");
assertThat(database).isEqualTo(Database.DEFAULT);
});
}
use of org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter in project tutorials by eugenp.
the class MySQLAutoconfiguration method entityManagerFactory.
@Bean
@ConditionalOnBean(name = "dataSource")
@ConditionalOnMissingBean
public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
final LocalContainerEntityManagerFactoryBean em = new LocalContainerEntityManagerFactoryBean();
em.setDataSource(dataSource());
em.setPackagesToScan("com.baeldung.autoconfiguration.example");
em.setJpaVendorAdapter(new HibernateJpaVendorAdapter());
if (additionalProperties() != null) {
em.setJpaProperties(additionalProperties());
}
return em;
}
use of org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter in project tutorials by eugenp.
the class H2JpaConfig method entityManagerFactory.
@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
final LocalContainerEntityManagerFactoryBean em = new LocalContainerEntityManagerFactoryBean();
em.setDataSource(dataSource());
em.setPackagesToScan(new String[] { "org.baeldung.boot.domain", "org.baeldung.boot.model", "org.baeldung.boot.boottest", "org.baeldung.model" });
em.setJpaVendorAdapter(new HibernateJpaVendorAdapter());
em.setJpaProperties(additionalProperties());
return em;
}
Aggregations