Java Examples for org.hibernate.type.descriptor.sql.JdbcTypeFamilyInformation

The following java examples will help you to understand the usage of org.hibernate.type.descriptor.sql.JdbcTypeFamilyInformation. These source code samples are taken from different open source projects.

Example 1
Project: hibernate-orm-master  File: AbstractSchemaValidator.java View source code
protected void validateColumnType(Table table, Column column, ColumnInformation columnInformation, Metadata metadata, ExecutionOptions options, Dialect dialect) {
    boolean typesMatch = column.getSqlTypeCode(metadata) == columnInformation.getTypeCode() || column.getSqlType(dialect, metadata).toLowerCase(Locale.ROOT).startsWith(columnInformation.getTypeName().toLowerCase(Locale.ROOT));
    if (!typesMatch) {
        throw new SchemaManagementException(String.format("Schema-validation: wrong column type encountered in column [%s] in " + "table [%s]; found [%s (Types#%s)], but expecting [%s (Types#%s)]", column.getName(), table.getQualifiedTableName(), columnInformation.getTypeName().toLowerCase(Locale.ROOT), JdbcTypeNameMapper.getTypeName(columnInformation.getTypeCode()), column.getSqlType().toLowerCase(Locale.ROOT), JdbcTypeNameMapper.getTypeName(column.getSqlTypeCode(metadata))));
    }
// this is the old Hibernate check...
//
// but I think a better check involves checks against type code and then the type code family, not
// just the type name.
//
// See org.hibernate.type.descriptor.sql.JdbcTypeFamilyInformation
// todo : this ^^
}