org.hibernate.dialect.Oracle12cDialect Java Examples

The following examples show how to use org.hibernate.dialect.Oracle12cDialect. 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: HibernateJpaVendorAdapter.java    From spring-analysis-note with MIT License 6 votes vote down vote up
/**
 * Determine the Hibernate database dialect class for the given target database.
 * @param database the target database
 * @return the Hibernate database dialect class, or {@code null} if none found
 */
@Nullable
protected Class<?> determineDatabaseDialectClass(Database database) {
	switch (database) {
		case DB2: return DB2Dialect.class;
		case DERBY: return DerbyTenSevenDialect.class;
		case H2: return H2Dialect.class;
		case HANA: return HANAColumnStoreDialect.class;
		case HSQL: return HSQLDialect.class;
		case INFORMIX: return InformixDialect.class;
		case MYSQL: return MySQL5Dialect.class;
		case ORACLE: return Oracle12cDialect.class;
		case POSTGRESQL: return PostgreSQL95Dialect.class;
		case SQL_SERVER: return SQLServer2012Dialect.class;
		case SYBASE: return SybaseDialect.class;
		default: return null;
	}
}
 
Example #2
Source File: HibernateJpaVendorAdapter.java    From java-technology-stack with MIT License 6 votes vote down vote up
/**
 * Determine the Hibernate database dialect class for the given target database.
 * @param database the target database
 * @return the Hibernate database dialect class, or {@code null} if none found
 */
@Nullable
protected Class<?> determineDatabaseDialectClass(Database database) {
	switch (database) {
		case DB2: return DB2Dialect.class;
		case DERBY: return DerbyTenSevenDialect.class;
		case H2: return H2Dialect.class;
		case HANA: return HANAColumnStoreDialect.class;
		case HSQL: return HSQLDialect.class;
		case INFORMIX: return InformixDialect.class;
		case MYSQL: return MySQL5Dialect.class;
		case ORACLE: return Oracle12cDialect.class;
		case POSTGRESQL: return PostgreSQL95Dialect.class;
		case SQL_SERVER: return SQLServer2012Dialect.class;
		case SYBASE: return SybaseDialect.class;
		default: return null;
	}
}
 
Example #3
Source File: DatabaseSchemaUpdateTest.java    From jpa2ddl with Apache License 2.0 6 votes vote down vote up
@Test
public void shouldGenerateSchemaFromDatabaseWithUpdateWithOracleDialect() throws Exception {
	// given
	File outputPath = tempFolder.newFolder();
	Properties jpaProperties = new Properties();
	jpaProperties.setProperty("hibernate.dialect", Oracle12cDialect.class.getCanonicalName());

	SchemaGenerator schemaGenerator = new SchemaGenerator();

	// when
	schemaGenerator.generate(new GeneratorSettings(GenerationMode.DATABASE, outputPath,
			Arrays.asList("com.devskiller.jpa2ddl.sample"), Action.UPDATE, jpaProperties, true, ";", false));

	// then
	String sql = new String(Files.readAllBytes(outputPath.toPath().resolve("v1__jpa2ddl.sql")));
	assertThat(sql).contains("create table User");
	assertThat(sql).doesNotContain("drop table User");
}