下面列出了怎么用org.hibernate.dialect.DerbyDialect的API类实例代码及写法,或者点击链接到github查看源代码。
/**
* 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
*/
@SuppressWarnings("deprecation")
protected Class<?> determineDatabaseDialectClass(Database database) {
switch (database) {
case DB2: return DB2Dialect.class;
case DERBY: return DerbyDialect.class; // DerbyDialect deprecated in 4.x
case H2: return H2Dialect.class;
case HSQL: return HSQLDialect.class;
case INFORMIX: return InformixDialect.class;
case MYSQL: return MySQL5Dialect.class;
case ORACLE: return Oracle9iDialect.class;
case POSTGRESQL: return PostgreSQLDialect.class; // PostgreSQLDialect deprecated in 4.x
case SQL_SERVER: return SQLServer2008Dialect.class;
case SYBASE: return org.hibernate.dialect.SybaseDialect.class; // SybaseDialect deprecated in 3.6 but not 4.x
default: return null;
}
}
/**
* 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
*/
@SuppressWarnings("deprecation")
protected Class<?> determineDatabaseDialectClass(Database database) {
switch (database) {
case DB2: return DB2Dialect.class;
case DERBY: return DerbyDialect.class; // DerbyDialect deprecated in 4.x
case H2: return H2Dialect.class;
case HSQL: return HSQLDialect.class;
case INFORMIX: return InformixDialect.class;
case MYSQL: return MySQLDialect.class;
case ORACLE: return Oracle9iDialect.class;
case POSTGRESQL: return PostgreSQLDialect.class; // PostgreSQLDialect deprecated in 4.x
case SQL_SERVER: return SQLServerDialect.class;
case SYBASE: return org.hibernate.dialect.SybaseDialect.class; // SybaseDialect deprecated in 3.6 but not 4.x
default: return null;
}
}
/**
* Does the db/dialect support using a column's physical name in the having clause
* even after it has been aliased in the select/group-by clause. This is not actually
* required by the SQL spec, although virtually ever DB in the world supports this.
*
* @param testDescription description of the scenario being tested.
* @return true if is allowed
*/
protected boolean allowsPhysicalColumnNameInHaving(String testDescription) {
// I only *know* of this being a limitation on Derby, although I highly suspect
// it is a limitation on any IBM/DB2 variant
if ( DerbyDialect.class.isInstance( getDialect() ) ) {
// https://issues.apache.org/jira/browse/DERBY-1624
reportSkip( "Dialect does not support physical column name in having clause after it is aliased", testDescription );
return false;
}
return true;
}
/**
* Does the db/dialect support using a column's physical name in the having clause
* even after it has been aliased in the select/group-by clause. This is not actually
* required by the SQL spec, although virtually ever DB in the world supports this.
*
* @param testDescription description of the scenario being tested.
* @return true if is allowed
*/
protected boolean allowsPhysicalColumnNameInHaving(String testDescription) {
// I only *know* of this being a limitation on Derby, although I highly suspect
// it is a limitation on any IBM/DB2 variant
if ( DerbyDialect.class.isInstance( getDialect() ) ) {
// https://issues.apache.org/jira/browse/DERBY-1624
reportSkip( "Dialect does not support physical column name in having clause after it is aliased", testDescription );
return false;
}
return true;
}