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

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

Introduction

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

Prototype

Database POSTGRESQL

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

Click Source Link

Usage

From source file:com.xpeppers.phonedirectory.config.DatastoreConfig.java

@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
    HibernateJpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();
    vendorAdapter.setDatabase(Database.POSTGRESQL);
    vendorAdapter.setGenerateDdl(false);
    vendorAdapter.setShowSql(true);//from   w  ww.  j  av a2 s. c  o m

    LocalContainerEntityManagerFactoryBean factoryBean = new LocalContainerEntityManagerFactoryBean();
    factoryBean.setJpaVendorAdapter(vendorAdapter);
    factoryBean.setPackagesToScan(DOMAIN_PACKAGE);
    factoryBean.setDataSource(dataSource);
    return factoryBean;
}

From source file:br.eti.danielcamargo.backend.common.config.context.CoreConfig.java

@Bean
public HibernateJpaVendorAdapter jpaVendorAdapter() {
    HibernateJpaVendorAdapter jpaVendorAdapter = new HibernateJpaVendorAdapter();
    jpaVendorAdapter.setShowSql(true);/*from w  ww.  j  av  a2 s  .  com*/
    jpaVendorAdapter.setDatabase(Database.POSTGRESQL);
    return jpaVendorAdapter;
}

From source file:com.oreilly.springdata.rest.ApplicationConfig.java

/**
 * Sets up a {@link LocalContainerEntityManagerFactoryBean} to use Hibernate. Activates picking up entities from the
 * project's base package.//from  w ww .j ava  2s. co m
 * 
 * @return
 */
@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory() {

    HibernateJpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();
    vendorAdapter.setDatabase(Database.POSTGRESQL);
    vendorAdapter.setGenerateDdl(true);

    LocalContainerEntityManagerFactoryBean factory = new LocalContainerEntityManagerFactoryBean();
    factory.setJpaVendorAdapter(vendorAdapter);
    factory.setPackagesToScan(getClass().getPackage().getName());
    factory.setDataSource(dataSource());

    return factory;
}

From source file:com.springsource.html5expense.config.ComponentConfig.java

@Bean
public JpaVendorAdapter jpaAdapter() {
    HibernateJpaVendorAdapter hibernateJpaVendorAdapter = new HibernateJpaVendorAdapter();
    hibernateJpaVendorAdapter.setShowSql(true);
    hibernateJpaVendorAdapter.setDatabase(Database.POSTGRESQL);
    hibernateJpaVendorAdapter.setShowSql(true);
    hibernateJpaVendorAdapter.setGenerateDdl(true);
    return hibernateJpaVendorAdapter;
}

From source file:de.alexandria.cms.config.SpringConfigBackendDatabase.java

@Bean
public JpaVendorAdapter jpaVendorAdapter() {
    HibernateJpaVendorAdapter jpaVendorAdapter = new HibernateJpaVendorAdapter();
    jpaVendorAdapter.setDatabase(Database.POSTGRESQL);
    jpaVendorAdapter.setShowSql(true);//  w  w w .  j  a  va  2  s  . c o  m
    return jpaVendorAdapter;
}

From source file:calculus.backend.JpaConfig.java

/**
 * /*  w  ww.j  a va  2 s . c  o  m*/
 */
public void loadProperties() {

    if (!Boolean.TRUE.equals(enablePropertiesConfig)) {
        loadEnviromentConfig();
    } else {
        switch (DataBaseTypeEnum.valueOf(dataBaseType)) {
        case mysql:
            dataBase = Database.MYSQL;
            break;
        case postgresql:
            dataBase = Database.POSTGRESQL;
            break;
        default:
            throw new IllegalArgumentException("El tipo de base de datos introducido, dataBaseType='"
                    + dataBaseType + "' no es soportado. Solo son vlidos 'mysql' y 'postgresql'");
        }
    }

    LOG.info("Usando DB url=" + url);

    // y otro mas: Neroku
    //            this.driver = "com.mysql.jdbc.Driver";
    //            this.url = "jdbc:mysql://sql3.freemysqlhosting.net:3306/sql3138396";
    //            this.user = "sql3138396";
    //            this.pass = "R6KXYvjsVJ";
    //            this.dataBase = Database.MYSQL;
    //            this.poolSize = 3;

}

From source file:calculus.backend.JpaConfig.java

/**
 * //from  w w  w.jav a2s  . co m
 */
private void loadEnviromentConfig() {
    LOG.info("Cargando configuracion de la BDs en funcion del ambiente ..");

    String env = "RD00155DFBD797"; //DEFAULT_ENV
    try {
        env = InetAddress.getLocalHost().getHostName();
    } catch (UnknownHostException ex) {
        LOG.error(ex.getMessage(), ex);
    }

    LOG.info("env=" + env);

    if (env.equals("localhost")) {
        //postgres local
        this.driver = "org.postgresql.Driver";
        this.url = "jdbc:postgresql://localhost:5432/pis2016";
        this.user = "postgres";
        this.pass = "user";
        this.dataBase = Database.POSTGRESQL;
        this.poolSize = 1;
    } else if (env.equals("RD00155DFBD985")) { //AZURE_PROD
        this.driver = "org.postgresql.Driver";
        this.url = "jdbc:postgresql://nutty-custard-apple.db.elephantsql.com:5432/gxedfpdw";
        this.user = "gxedfpdw";
        this.pass = "Ci05wYOZACatHbnzav_VmHiSIF6J-fNB";
        this.dataBase = Database.POSTGRESQL;
        this.poolSize = 1;
    } else if (env.equals("abentan-PC")) {
        this.driver = "com.mysql.jdbc.Driver";
        this.url = "jdbc:mysql://localhost:3306/pis2016";
        this.user = "pis2016";
        this.pass = "pis2016";
        this.dataBase = Database.MYSQL;
        this.poolSize = 5;
    } else if (env.equals("RD00155DFBD797")) { //AZURE_BETA
        this.driver = "org.postgresql.Driver";
        this.url = "jdbc:postgresql://nutty-custard-apple.db.elephantsql.com:5432/fbonhmwr";
        this.user = "fbonhmwr";
        this.pass = "4axmS5tbJRUh_f5j8K2LBQZ8wrEO4jBR";
        this.dataBase = Database.POSTGRESQL;
        this.poolSize = 1;
    } else if (env.equals("MacBook-Pro.local")) {
        this.driver = "org.postgresql.Driver";
        this.url = "jdbc:postgresql://localhost:5432/pis2016";
        this.user = "tavidian";
        this.pass = "";
        this.dataBase = Database.POSTGRESQL;
        this.poolSize = 1;
    } else if (env.equals("NetPC")) {
        //postgres local
        this.driver = "org.postgresql.Driver";
        this.url = "jdbc:postgresql://localhost:5432/postgres";
        this.user = "postgres";
        this.pass = "4512161-7";
        this.dataBase = Database.POSTGRESQL;
        this.poolSize = 1;
    } else if (env.equals("MARTINV-DELL")) {
        //postgres local
        this.driver = "org.postgresql.Driver";
        this.url = "jdbc:postgresql://localhost:5432/postgres";
        this.user = "postgres";
        this.pass = "user";
        this.dataBase = Database.POSTGRESQL;
        this.poolSize = 1;
    } else if (env.equals("PC3")) {
        this.driver = "org.postgresql.Driver";
        this.url = "jdbc:postgresql://localhost:5432/pis2016";
        this.user = "postgres";
        this.pass = "admin";
        this.dataBase = Database.POSTGRESQL;
        this.poolSize = 1;
    }
}