Java Code Examples for org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter#setDatabase()
The following examples show how to use
org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter#setDatabase() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DaoSpringModuleConfig.java From herd with Apache License 2.0 | 6 votes |
/** * Gets the Hibernate JPA vendor adapter needed by the entity manager. * * @return the Hibernate JPA vendor adapter. */ private JpaVendorAdapter getHibernateJpaVendorAdapter() { HibernateJpaVendorAdapter hibernateJpaVendorAdapter = new HibernateJpaVendorAdapter(); // Set the database type. String databaseType = configurationHelper.getProperty(ConfigurationValue.DATABASE_TYPE); if (StringUtils.isBlank(databaseType)) { throw new IllegalStateException( String.format("No database type found. Ensure the \"%s\" configuration entry is configured.", ConfigurationValue.DATABASE_TYPE.getKey())); } Database database = Database.valueOf(databaseType); LOGGER.info("jpaTargetDatabase={}", database); hibernateJpaVendorAdapter.setDatabase(database); hibernateJpaVendorAdapter.setGenerateDdl(false); return hibernateJpaVendorAdapter; }
Example 2
Source File: JpaInfrastructureConfig.java From spring-content with Apache License 2.0 | 6 votes |
@Bean public LocalContainerEntityManagerFactoryBean entityManagerFactory() { HibernateJpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter(); vendorAdapter.setDatabase(Database.HSQL); vendorAdapter.setGenerateDdl(true); LocalContainerEntityManagerFactoryBean factory = new LocalContainerEntityManagerFactoryBean(); factory.setJpaVendorAdapter(vendorAdapter); factory.setPackagesToScan(packagesToScan()); factory.setPersistenceUnitName("spring-data-rest-webmvc"); factory.setDataSource(dataSource()); factory.afterPropertiesSet(); return factory; }
Example 3
Source File: Application.java From JPA-Specifications-Example with Apache License 2.0 | 5 votes |
@Bean public JpaVendorAdapter jpaVendorAdapter() { HibernateJpaVendorAdapter hibernateJpaVendorAdapter = new HibernateJpaVendorAdapter(); hibernateJpaVendorAdapter.setShowSql(false); hibernateJpaVendorAdapter.setGenerateDdl(true); hibernateJpaVendorAdapter.setDatabase(Database.H2); return hibernateJpaVendorAdapter; }
Example 4
Source File: MainConfig.java From spring-boot-jta-atomikos-sample with Apache License 2.0 | 5 votes |
@Bean public JpaVendorAdapter jpaVendorAdapter() { HibernateJpaVendorAdapter hibernateJpaVendorAdapter = new HibernateJpaVendorAdapter(); hibernateJpaVendorAdapter.setShowSql(true); hibernateJpaVendorAdapter.setGenerateDdl(true); hibernateJpaVendorAdapter.setDatabase(Database.MYSQL); return hibernateJpaVendorAdapter; }
Example 5
Source File: DataStoreConfig.java From tutorials with MIT License | 5 votes |
@Bean public JpaVendorAdapter jpaVendorAdapter() { final HibernateJpaVendorAdapter bean = new HibernateJpaVendorAdapter(); bean.setDatabase(Database.H2); bean.setGenerateDdl(true); return bean; }
Example 6
Source File: DatabaseConfiguration.java From flowable-engine with Apache License 2.0 | 5 votes |
@Bean(name = "entityManagerFactory") public EntityManagerFactory entityManagerFactory(DataSource dataSource) { LocalContainerEntityManagerFactoryBean entityManagerFactoryBean = new LocalContainerEntityManagerFactoryBean(); entityManagerFactoryBean.setDataSource(dataSource); entityManagerFactoryBean.setPackagesToScan("org.flowable.rest.api.jpa.model"); entityManagerFactoryBean.setPersistenceUnitName("test"); HibernateJpaVendorAdapter hibernateJpaVendorAdapter = new HibernateJpaVendorAdapter(); hibernateJpaVendorAdapter.setShowSql(false); hibernateJpaVendorAdapter.setGenerateDdl(true); hibernateJpaVendorAdapter.setDatabase(Database.H2); entityManagerFactoryBean.setJpaVendorAdapter(hibernateJpaVendorAdapter); entityManagerFactoryBean.afterPropertiesSet(); return entityManagerFactoryBean.getObject(); }
Example 7
Source File: AppConfig.java From Spring-Framework-Essentials with MIT License | 5 votes |
@Bean public JpaVendorAdapter jpaVendorAdapter() { HibernateJpaVendorAdapter adapter = new HibernateJpaVendorAdapter(); adapter.setShowSql(true); adapter.setGenerateDdl(true); adapter.setDatabase(Database.MYSQL); return adapter; }
Example 8
Source File: JpaConfiguration.java From ps-guitar-db with Apache License 2.0 | 5 votes |
@Bean public JpaVendorAdapter jpaVendorAdapter() { HibernateJpaVendorAdapter hibernateJpaVendorAdapter = new HibernateJpaVendorAdapter(); hibernateJpaVendorAdapter.setShowSql(true); hibernateJpaVendorAdapter.setGenerateDdl(true); hibernateJpaVendorAdapter.setDatabase(Database.H2); return hibernateJpaVendorAdapter; }
Example 9
Source File: EnableJpaStoresTest.java From spring-content with Apache License 2.0 | 5 votes |
@Bean public LocalContainerEntityManagerFactoryBean entityManagerFactory() { HibernateJpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter(); vendorAdapter.setDatabase(Database.HSQL); vendorAdapter.setGenerateDdl(true); LocalContainerEntityManagerFactoryBean factory = new LocalContainerEntityManagerFactoryBean(); factory.setJpaVendorAdapter(vendorAdapter); factory.setPackagesToScan(getClass().getPackage().getName()); factory.setDataSource(dataSource()); return factory; }
Example 10
Source File: ElasticsearchConfig.java From spring-content with Apache License 2.0 | 5 votes |
@Bean public LocalContainerEntityManagerFactoryBean entityManagerFactory() { HibernateJpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter(); vendorAdapter.setDatabase(Database.H2); vendorAdapter.setGenerateDdl(true); LocalContainerEntityManagerFactoryBean factory = new LocalContainerEntityManagerFactoryBean(); factory.setJpaVendorAdapter(vendorAdapter); factory.setPackagesToScan("org.springframework.content.elasticsearch"); factory.setDataSource(dataSource()); return factory; }
Example 11
Source File: EmbeddedDataSourceConfig.java From spring-sync with Apache License 2.0 | 5 votes |
@Bean public JpaVendorAdapter jpaVendorAdapter() { HibernateJpaVendorAdapter hibernateJpaVendorAdapter = new HibernateJpaVendorAdapter(); hibernateJpaVendorAdapter.setShowSql(false); hibernateJpaVendorAdapter.setGenerateDdl(true); hibernateJpaVendorAdapter.setDatabase(Database.H2); return hibernateJpaVendorAdapter; }
Example 12
Source File: DatabaseConfig.java From cloudbreak with Apache License 2.0 | 5 votes |
@Bean public JpaVendorAdapter jpaVendorAdapter() { HibernateJpaVendorAdapter hibernateJpaVendorAdapter = new HibernateJpaVendorAdapter(); hibernateJpaVendorAdapter.setShowSql(true); hibernateJpaVendorAdapter.setDatabase(Database.POSTGRESQL); return hibernateJpaVendorAdapter; }
Example 13
Source File: JpaConfig.java From Project with Apache License 2.0 | 5 votes |
@Bean public JpaVendorAdapter jpaVendorAdapter() { HibernateJpaVendorAdapter adapter = new HibernateJpaVendorAdapter(); adapter.setDatabase(Database.H2); adapter.setShowSql(true); adapter.setGenerateDdl(false); adapter.setDatabasePlatform("org.hibernate.dialect.H2Dialect"); return adapter; }
Example 14
Source File: DatabaseConfig.java From cloudbreak with Apache License 2.0 | 5 votes |
@Bean public JpaVendorAdapter jpaVendorAdapter() { HibernateJpaVendorAdapter hibernateJpaVendorAdapter = new HibernateJpaVendorAdapter(); hibernateJpaVendorAdapter.setShowSql(true); hibernateJpaVendorAdapter.setDatabase(Database.POSTGRESQL); return hibernateJpaVendorAdapter; }
Example 15
Source File: DatabaseConfiguration.java From activiti6-boot2 with Apache License 2.0 | 5 votes |
@Bean(name = "entityManagerFactory") public EntityManagerFactory entityManagerFactory() { LocalContainerEntityManagerFactoryBean entityManagerFactoryBean = new LocalContainerEntityManagerFactoryBean(); entityManagerFactoryBean.setDataSource(dataSource()); entityManagerFactoryBean.setPackagesToScan("org.activiti.rest.api.jpa.model"); entityManagerFactoryBean.setPersistenceUnitName("test"); HibernateJpaVendorAdapter hibernateJpaVendorAdapter = new HibernateJpaVendorAdapter(); hibernateJpaVendorAdapter.setShowSql(false); hibernateJpaVendorAdapter.setGenerateDdl(true); hibernateJpaVendorAdapter.setDatabase(Database.H2); entityManagerFactoryBean.setJpaVendorAdapter(hibernateJpaVendorAdapter); entityManagerFactoryBean.afterPropertiesSet(); return entityManagerFactoryBean.getObject(); }
Example 16
Source File: InfrastructureConfig.java From Learning-Path-Spring-5-End-to-End-Programming with MIT License | 5 votes |
@Bean public JpaVendorAdapter jpaVendorAdapter() { HibernateJpaVendorAdapter bean = new HibernateJpaVendorAdapter(); bean.setDatabase(org.springframework.orm.jpa.vendor.Database.H2); bean.setGenerateDdl(true); return bean; }
Example 17
Source File: SpringDataITest.java From java-specialagent with Apache License 2.0 | 5 votes |
@Bean public LocalContainerEntityManagerFactoryBean entityManagerFactory() { final HibernateJpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter(); vendorAdapter.setDatabase(Database.H2); vendorAdapter.setGenerateDdl(true); final LocalContainerEntityManagerFactoryBean em = new LocalContainerEntityManagerFactoryBean(); em.setDataSource(dataSource()); em.setPackagesToScan("io.opentracing.contrib.specialagent.test.spring.data"); em.setJpaVendorAdapter(vendorAdapter); return em; }
Example 18
Source File: JpaConfiguration.java From Spring with Apache License 2.0 | 5 votes |
@Bean public JpaVendorAdapter jpaVendorAdapter() { final HibernateJpaVendorAdapter hibernateJpaVendorAdapter = new HibernateJpaVendorAdapter(); hibernateJpaVendorAdapter.setShowSql(true); hibernateJpaVendorAdapter.setGenerateDdl(true); hibernateJpaVendorAdapter.setDatabase(Database.H2); return hibernateJpaVendorAdapter; }
Example 19
Source File: JpaConfig.java From Project with Apache License 2.0 | 5 votes |
@Bean public JpaVendorAdapter jpaVendorAdapter() { HibernateJpaVendorAdapter adapter = new HibernateJpaVendorAdapter(); adapter.setDatabase(Database.H2); adapter.setShowSql(true); adapter.setGenerateDdl(false); adapter.setDatabasePlatform("org.hibernate.dialect.H2Dialect"); return adapter; }
Example 20
Source File: SpringDataJpaConfig.java From Project with Apache License 2.0 | 5 votes |
@Bean public HibernateJpaVendorAdapter jpaVendorAdapter() { HibernateJpaVendorAdapter adapter = new HibernateJpaVendorAdapter(); adapter.setDatabase(Database.H2); adapter.setShowSql(false); adapter.setGenerateDdl(true); return adapter; }