Java Code Examples for org.hibernate.dialect.SQLServer2012Dialect

The following examples show how to use org.hibernate.dialect.SQLServer2012Dialect. These examples are extracted from open source projects. 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 Project: spring-analysis-note   Source File: HibernateJpaVendorAdapter.java    License: 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 Project: java-technology-stack   Source File: HibernateJpaVendorAdapter.java    License: 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 Project: quarkus   Source File: HibernateOrmProcessor.java    License: Apache License 2.0 6 votes vote down vote up
public static Optional<String> guessDialect(Optional<String> dbKind) {
    // For now select the latest dialect from the driver
    // later, we can keep doing that but also avoid DCE
    // of all the dialects we want in so that people can override them
    String resolvedDbKind = dbKind.orElse("NO_DATABASE_KIND");
    if (DatabaseKind.isDB2(resolvedDbKind)) {
        return Optional.of(DB297Dialect.class.getName());
    }
    if (DatabaseKind.isPostgreSQL(resolvedDbKind)) {
        return Optional.of(QuarkusPostgreSQL10Dialect.class.getName());
    }
    if (DatabaseKind.isH2(resolvedDbKind)) {
        return Optional.of(QuarkusH2Dialect.class.getName());
    }
    if (DatabaseKind.isMariaDB(resolvedDbKind)) {
        return Optional.of(MariaDB103Dialect.class.getName());
    }
    if (DatabaseKind.isMySQL(resolvedDbKind)) {
        return Optional.of(MySQL8Dialect.class.getName());
    }
    if (DatabaseKind.isDerby(resolvedDbKind)) {
        return Optional.of(DerbyTenSevenDialect.class.getName());
    }
    if (DatabaseKind.isMsSQL(resolvedDbKind)) {
        return Optional.of(SQLServer2012Dialect.class.getName());
    }

    String error = dbKind.isPresent()
            ? "Hibernate extension could not guess the dialect from the database kind '" + resolvedDbKind
                    + "'. Add an explicit '" + HIBERNATE_ORM_CONFIG_PREFIX + "dialect' property."
            : "Hibernate extension cannot guess the dialect as no database kind is specified by 'quarkus.datasource.db-kind'";
    throw new ConfigurationError(error);
}