List of usage examples for org.springframework.orm.jpa.vendor HibernateJpaVendorAdapter setDatabasePlatform
public void setDatabasePlatform(@Nullable String databasePlatform)
From source file:rzd.vivc.documentexamination.configuration.SpringDateConfigMySQL.java
/** * ?? /*from w w w . ja va 2 s . c o m*/ * * @return ? */ @Bean public JpaVendorAdapter jpaVendorAdapter() { HibernateJpaVendorAdapter adapter = new HibernateJpaVendorAdapter(); adapter.setDatabase(Database.MYSQL); adapter.setShowSql(true); adapter.setGenerateDdl(true); adapter.setDatabasePlatform("org.hibernate.dialect.MySQLDialect"); return adapter; }
From source file:br.com.shopcarpet.config.JpaConfig.java
/** * Configuracao opcao do hibernate como o dialeto. * *///from w w w .j av a2 s .c om @Bean public JpaVendorAdapter getJpaVendorAdapter() { HibernateJpaVendorAdapter adapter = new HibernateJpaVendorAdapter(); adapter.setDatabase(Database.MYSQL); adapter.setShowSql(true); adapter.setGenerateDdl(true); adapter.setDatabasePlatform("org.hibernate.dialect.MySQL5Dialect"); return adapter; }
From source file:org.apigw.monitoring.config.PersistenceConfig.java
@Bean @DependsOn("flyway") public LocalContainerEntityManagerFactoryBean entityManagerFactory() { log.debug("Setting up entityManagerFactory"); LocalContainerEntityManagerFactoryBean factory = new LocalContainerEntityManagerFactoryBean(); HibernateJpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter(); vendorAdapter.setShowSql(Boolean.getBoolean(hibernateShowSql)); vendorAdapter.setDatabasePlatform("org.hibernate.dialect." + hibernateDialect); factory.setDataSource(dataSource()); factory.setJpaVendorAdapter(vendorAdapter); factory.setPackagesToScan("org.apigw.monitoring.types.domain"); Properties jpaProperties = new Properties(); factory.setJpaProperties(jpaProperties); factory.afterPropertiesSet();/*from www.j av a2s .com*/ factory.setLoadTimeWeaver(new InstrumentationLoadTimeWeaver()); return factory; }
From source file:com.gordondickens.app.infrastructure.config.db.JpaPersistenceCommonConfig.java
@Bean public LocalContainerEntityManagerFactoryBean entityManagerFactory() { logger.debug("\n\n************ {} ************\n\n", getDatabaseDialect().getCanonicalName()); HibernateJpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter(); vendorAdapter.setGenerateDdl(true);//from ww w.j a v a 2s .co m vendorAdapter.setDatabasePlatform(getDatabaseDialect().getName()); vendorAdapter.setShowSql(true); LocalContainerEntityManagerFactoryBean factory = new LocalContainerEntityManagerFactoryBean(); factory.setJpaVendorAdapter(vendorAdapter); factory.setPackagesToScan(Employee.class.getPackage().getName()); factory.setDataSource(dataSource()); if (getJpaProperties() != null) { factory.setJpaProperties(getJpaProperties()); } return factory; }
From source file:ru.develgame.jflickrorganizer.MainClass.java
@Bean public JpaVendorAdapter jpaVendorAdapter() { HibernateJpaVendorAdapter jpaVendorAdapter = new HibernateJpaVendorAdapter(); jpaVendorAdapter.setShowSql(false);//from w w w .ja v a 2 s.co m jpaVendorAdapter.setGenerateDdl(true); jpaVendorAdapter.setDatabasePlatform("ru.develgame.jflickrorganizer.Common.SQLiteDialect"); return jpaVendorAdapter; }
From source file:dubbo.spring.javaconfig.DatabaseConfig.java
/** * jpa/*from w w w. ja v a 2 s . c om*/ */ private JpaVendorAdapter jpaVendorAdapter() { HibernateJpaVendorAdapter jpaVendorAdapter = new HibernateJpaVendorAdapter(); jpaVendorAdapter.setDatabasePlatform(DriverType.valueOf(dbConnDriverType).getPlatform()); return jpaVendorAdapter; }
From source file:io.convergencia.training.Application.java
@Bean public HibernateJpaVendorAdapter jpaVendorAdapter() { HibernateJpaVendorAdapter jpaVendorAdapter = new HibernateJpaVendorAdapter(); jpaVendorAdapter.setShowSql(true);//from w w w .j a va 2 s . com jpaVendorAdapter.setGenerateDdl(true); jpaVendorAdapter.setDatabasePlatform("org.hibernate.dialect.PostgreSQLDialect"); return jpaVendorAdapter; }
From source file:com.ipet.server.config.JPAConfiguration.java
@Bean public JpaVendorAdapter jpaVendorAdapter() { HibernateJpaVendorAdapter jpaVendorAdapter = new HibernateJpaVendorAdapter(); jpaVendorAdapter.setDatabase(Database.MYSQL); jpaVendorAdapter.setGenerateDdl(true); jpaVendorAdapter.setShowSql(true);/*from ww w .j a va2 s . co m*/ jpaVendorAdapter.setDatabasePlatform("org.hibernate.dialect.MySQL5Dialect"); //return jpaVendorAdapter; return null; }
From source file:org.ng200.openolympus.Application.java
@Bean public HibernateJpaVendorAdapter jpaVendorAdapter() { final HibernateJpaVendorAdapter adapter = new HibernateJpaVendorAdapter(); adapter.setShowSql(false);/* w ww .j a v a2 s. c om*/ adapter.setGenerateDdl(true); adapter.setDatabasePlatform("org.ng200.openolympus.OpenOlympusPostgreDialect"); return adapter; }
From source file:ch.javaee.basicMvc.config.StandaloneDataConfig.java
@Bean public LocalContainerEntityManagerFactoryBean entityManagerFactory() { LocalContainerEntityManagerFactoryBean lcemfb = new LocalContainerEntityManagerFactoryBean(); lcemfb.setDataSource(this.hsqlInMemory()); lcemfb.setPackagesToScan(new String[] { "ch.javaee.basicMvc.domain" }); lcemfb.setPersistenceUnitName("MyPU"); HibernateJpaVendorAdapter va = new HibernateJpaVendorAdapter(); lcemfb.setJpaVendorAdapter(va);/*from w w w.j a va 2s . c om*/ va.setDatabase(Database.HSQL); va.setGenerateDdl(true); va.setShowSql(true); va.setDatabasePlatform("org.hibernate.dialect.HSQLDialect"); Properties ps = new Properties(); ps.put("hibernate.dialect", "org.hibernate.dialect.HSQLDialect"); ps.put("hibernate.hbm2ddl.auto", "create"); lcemfb.setJpaProperties(ps); lcemfb.afterPropertiesSet(); return lcemfb; }