use of org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter in project tutorials by eugenp.
the class H2TestProfileJPAConfig method entityManagerFactory.
@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
final LocalContainerEntityManagerFactoryBean em = new LocalContainerEntityManagerFactoryBean();
em.setDataSource(dataSource());
em.setPackagesToScan(new String[] { "org.baeldung.domain", "org.baeldung.boot.domain", "org.baeldung.boot.boottest", "org.baeldung.model" });
em.setJpaVendorAdapter(new HibernateJpaVendorAdapter());
em.setJpaProperties(additionalProperties());
return em;
}
use of org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter in project tutorials by eugenp.
the class PersistenceConfig 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.vendor.HibernateJpaVendorAdapter in project irida by phac-nml.
the class IridaApiJdbcDataSourceConfig method jpaVendorAdapter.
@Bean
public JpaVendorAdapter jpaVendorAdapter() {
HibernateJpaVendorAdapter adapter = new HibernateJpaVendorAdapter();
adapter.setShowSql(false);
adapter.setGenerateDdl(true);
adapter.setDatabase(Database.MYSQL);
return adapter;
}
use of org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter in project irida by phac-nml.
the class IridaApiTestDataSourceConfig method jpaVendorAdapter.
@Bean
public JpaVendorAdapter jpaVendorAdapter() {
HibernateJpaVendorAdapter adapter = new HibernateJpaVendorAdapter();
adapter.setShowSql(false);
adapter.setGenerateDdl(true);
adapter.setDatabase(Database.H2);
return adapter;
}
use of org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter in project BroadleafCommerce by BroadleafCommerce.
the class BroadleafCommonConfig method blJpaVendorAdapter.
/**
* Other enterprise/mulititenant modules override this adapter to provide one that supports dynamic filtration
*/
@Bean
@ConditionalOnMissingBean(name = "blJpaVendorAdapter")
public JpaVendorAdapter blJpaVendorAdapter() {
HibernateJpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();
// TODO see https://jira.spring.io/browse/SPR-13269. Since we're still on Hibernate 4.1, we want to revert to the previous
// Spring behavior, which was not to prepare the connection. This avoids some warnings and extra connection acquisitions
// for read only transactions. When we advance Hibernate, we should look at not blocking Spring's connection preparation.
vendorAdapter.setPrepareConnection(false);
return vendorAdapter;
}
Aggregations