Example usage for org.springframework.orm.jpa LocalContainerEntityManagerFactoryBean setJpaVendorAdapter

List of usage examples for org.springframework.orm.jpa LocalContainerEntityManagerFactoryBean setJpaVendorAdapter

Introduction

In this page you can find the example usage for org.springframework.orm.jpa LocalContainerEntityManagerFactoryBean setJpaVendorAdapter.

Prototype

public void setJpaVendorAdapter(@Nullable JpaVendorAdapter jpaVendorAdapter) 

Source Link

Document

Specify the JpaVendorAdapter implementation for the desired JPA provider, if any.

Usage

From source file:com.test.com.customer.classattendance.test.ConnectionConfigTest.java

@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory(DataSource dataSource,
        JpaVendorAdapter jpaVendorAdapter) {
    LocalContainerEntityManagerFactoryBean lef = new LocalContainerEntityManagerFactoryBean();
    lef.setDataSource(dataSource);//  w  w w .j  ava  2  s  . co  m
    lef.setJpaVendorAdapter(jpaVendorAdapter);
    lef.setPackagesToScan("com.customer.classattendance.domain");
    return lef;
}

From source file:com.tonata.photostudio2.app.conf.ConnectionConfig.java

@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory(DataSource dataSource,
        JpaVendorAdapter jpaVendorAdapter) {
    LocalContainerEntityManagerFactoryBean lef = new LocalContainerEntityManagerFactoryBean();
    lef.setDataSource(dataSource);/*from w w w .j av a 2s  . com*/
    lef.setJpaVendorAdapter(jpaVendorAdapter);
    lef.setPackagesToScan("com.tonata.photostudio2.domain");
    return lef;

}

From source file:pl.softech.eav.example.JpaConfig.java

@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory(JpaVendorAdapter jpaVendorAdapter,
        DataSource ds, @Value("${hibernate.show_sql}") String showSql,
        @Value("${hibernate.format_sql}") String formatSql,
        @Value("${hibernate.cache.use_second_level_cache}") String useSecondLevelCache) {
    LocalContainerEntityManagerFactoryBean lemfb = new LocalContainerEntityManagerFactoryBean();
    lemfb.setDataSource(ds);/*from w  w w  .  java 2  s  .c o  m*/
    lemfb.setJpaVendorAdapter(jpaVendorAdapter);
    lemfb.setPackagesToScan("pl.softech.eav.domain");
    Properties jpaProperties = new Properties();
    jpaProperties.setProperty("hibernate.cache.region.factory_class",
            "org.hibernate.cache.ehcache.EhCacheRegionFactory");
    jpaProperties.setProperty("hibernate.cache.use_second_level_cache", useSecondLevelCache);
    jpaProperties.setProperty("hibernate.show_sql", showSql);
    jpaProperties.setProperty("hibernate.format_sql", formatSql);
    /* See https://hibernate.atlassian.net/browse/HHH-8796 */
    jpaProperties.setProperty("hibernate.schema_update.unique_constraint_strategy", "RECREATE_QUIETLY");
    lemfb.setJpaProperties(jpaProperties);
    return lemfb;
}

From source file:com.cemeterylistingstest.test.ConnectionConfigTest.java

@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory(DataSource dataSource,
        JpaVendorAdapter jpaVendorAdapter) {
    LocalContainerEntityManagerFactoryBean lefb = new LocalContainerEntityManagerFactoryBean();
    lefb.setDataSource(dataSource);/*  ww  w.  j  a  v  a  2  s .c o m*/
    lefb.setJpaVendorAdapter(jpaVendorAdapter);
    lefb.setPackagesToScan("com.cemeterylistings.domain");
    return lefb;
}

From source file:za.co.dwarfsun.jcmanager.app.conf.ConnectionConfig.java

@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory(DataSource dataSource,
        JpaVendorAdapter jpaVendorAdapter) {
    LocalContainerEntityManagerFactoryBean lef = new LocalContainerEntityManagerFactoryBean();
    lef.setDataSource(dataSource);//from  w w w  .j  a va2  s. co m
    lef.setJpaVendorAdapter(jpaVendorAdapter);
    lef.setPackagesToScan("za.co.dwarfsun.jcmanager.domain");
    return lef;
}

From source file:com.cemeterylistingswebtest.test.ConnectionConfigTest.java

@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory(DataSource dataSource,
        JpaVendorAdapter jpaVendorAdapter) {
    LocalContainerEntityManagerFactoryBean lefb = new LocalContainerEntityManagerFactoryBean();
    lefb.setDataSource(dataSource);// w  ww.j  a  v a2 s.  c  o  m
    lefb.setJpaVendorAdapter(jpaVendorAdapter);
    lefb.setPackagesToScan("com.cemeterylistingsweb.domain");
    return lefb;
}

From source file:com.mycompany.cputauctionnew.app.config.ConnectionConfig.java

@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory(DataSource dataSource,
        JpaVendorAdapter jpaVendorAdapter) {
    LocalContainerEntityManagerFactoryBean lef = new LocalContainerEntityManagerFactoryBean();
    lef.setDataSource(dataSource);/*w w w . j  a  va 2 s  . co m*/
    lef.setJpaVendorAdapter(jpaVendorAdapter);
    lef.setPackagesToScan("com.mycompany.cputauctionnew.domain");
    return lef;
}

From source file:com.nkosy.propertymanager.app.ConnectionConfig.java

/**
 *
 * @param dataSource// w w  w.  jav  a 2 s. co  m
 * @param jpaVendorAdapter
 * @return
 */
@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory(DataSource dataSource,
        JpaVendorAdapter jpaVendorAdapter) {
    LocalContainerEntityManagerFactoryBean lef = new LocalContainerEntityManagerFactoryBean();
    lef.setDataSource(dataSource);
    lef.setJpaVendorAdapter(jpaVendorAdapter);
    lef.setPackagesToScan("com.nkosy.propertymanager.domain");
    return lef;
}

From source file:com.tchouyangoko.humain.app.config.ConnectionConfig.java

@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory(DataSource dataSource,
        JpaVendorAdapter jpaVendorAdapter) {
    LocalContainerEntityManagerFactoryBean lef = new LocalContainerEntityManagerFactoryBean();
    lef.setDataSource(dataSource);//from ww w .j  av  a 2  s  .c o  m
    lef.setJpaVendorAdapter(jpaVendorAdapter);
    lef.setPackagesToScan("com.tchouyangoko.humain.domain");
    return lef;
}

From source file:com.sg.domain.jpa.spring.PersistenceContextConfig.java

@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory(DataSource dataSource) {

    HibernateJpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();

    LocalContainerEntityManagerFactoryBean factory = new LocalContainerEntityManagerFactoryBean();
    factory.setJpaVendorAdapter(vendorAdapter);
    factory.setPackagesToScan("com.sg.domain.entities.jpa");
    factory.setDataSource(dataSource);//from   w ww.  ja v  a 2 s  . com

    Properties jpaProperties = new Properties();
    jpaProperties.put(org.hibernate.cfg.Environment.SHOW_SQL, hibernateShowSql);
    jpaProperties.put(org.hibernate.cfg.Environment.FORMAT_SQL, hibernateFormatSql);
    jpaProperties.put(org.hibernate.cfg.Environment.DIALECT, hibernateDialect);
    if (hibernateHbm2ddlAuto != null && !hibernateHbm2ddlAuto.isEmpty()) {
        jpaProperties.put(org.hibernate.cfg.Environment.HBM2DDL_AUTO, hibernateHbm2ddlAuto);
    }

    factory.setJpaProperties(jpaProperties);

    return factory;
}