Example usage for org.springframework.orm.jpa.vendor Database ORACLE

List of usage examples for org.springframework.orm.jpa.vendor Database ORACLE

Introduction

In this page you can find the example usage for org.springframework.orm.jpa.vendor Database ORACLE.

Prototype

Database ORACLE

To view the source code for org.springframework.orm.jpa.vendor Database ORACLE.

Click Source Link

Usage

From source file:com.mycompany.projetsportmanager.spring.configuration.DefaultProfileConfiguration.java

/**
 * Returns the JPA dialect to use.
 * @return the JPA dialect to use.
 */
@Bean
public Database jpaDialect() {
    return Database.ORACLE;
}

From source file:uk.ac.ebi.ep.data.dataconfig.DataConfig.java

@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
    LocalContainerEntityManagerFactoryBean em = new LocalContainerEntityManagerFactoryBean();
    //em.setPersistenceXmlLocation("classpath*:META-INF/persistence.xml");

    em.setDataSource(dataSource);/*from   w ww  . j  a  v  a 2  s . c o  m*/
    em.setPackagesToScan("uk.ac.ebi.ep.data.domain");

    Properties properties = new Properties();
    properties.setProperty("hibernate.cache.provider_class", "org.hibernate.cache.NoCacheProvider");
    properties.setProperty("hibernate.connection.driver_class", "oracle.jdbc.OracleDriver");

    HibernateJpaVendorAdapter vendor = new HibernateJpaVendorAdapter();
    vendor.setShowSql(false);
    vendor.setDatabase(Database.ORACLE);
    em.setJpaProperties(properties);
    em.setJpaVendorAdapter(vendor);

    return em;
}