final int declared_numeric_scale = 31;
Iterator it =
database.schemaManager.databaseObjectIterator(SchemaObject.DOMAIN);
while (it.hasNext()) {
Type distinct = (Type) it.next();
if (!distinct.isDistinctType()) {
continue;
}
Object[] data = t.getEmptyRowData();
data[user_defined_type_catalog] = database.getCatalogName().name;
data[user_defined_type_schema] = distinct.getSchemaName().name;
data[user_defined_type_name] = distinct.getName().name;
data[data_type] = distinct.getFullNameString();
data[declared_data_type] = distinct.getFullNameString();
data[user_defined_type_category] = "DISTINCT";
data[is_instantiable] = "YES";
data[is_final] = "YES";
data[ordering_form] = "FULL";
data[source_dtd_identifier] = distinct.getFullNameString();
if (distinct.isCharacterType()) {
data[character_maximum_length] =
ValuePool.getLong(distinct.precision);
data[character_octet_length] =
ValuePool.getLong(distinct.precision * 2);
data[character_set_catalog] = database.getCatalogName().name;
data[character_set_schema] =
((CharacterType) distinct).getCharacterSet()
.getSchemaName().name;
data[character_set_name] =
((CharacterType) distinct).getCharacterSet().getName()
.name;
data[collation_catalog] = database.getCatalogName().name;
data[collation_schema] =
((CharacterType) distinct).getCollation().getSchemaName()
.name;
data[collation_name] =
((CharacterType) distinct).getCollation().getName().name;
} else if (distinct.isNumberType()) {
data[numeric_precision] =
ValuePool.getLong(((NumberType) distinct).getPrecision());
data[declared_numeric_precision] =
ValuePool.getLong(((NumberType) distinct).getPrecision());
if (distinct.typeCode != Types.SQL_DOUBLE) {
data[numeric_scale] = ValuePool.getLong(distinct.scale);
data[declared_numeric_scale] =
ValuePool.getLong(distinct.scale);
}
data[numeric_precision_radix] = ValuePool.getLong(
((NumberType) distinct).getPrecisionRadix());
} else if (distinct.isBooleanType()) {}
else if (distinct.isDateTimeType()) {
data[datetime_precision] = ValuePool.getLong(distinct.scale);
} else if (distinct.isIntervalType()) {
data[interval_precision] =
ValuePool.getLong(distinct.precision);
data[interval_type] = distinct.getFullNameString();
data[datetime_precision] = ValuePool.getLong(distinct.scale);
} else if (distinct.isBinaryType()) {
data[character_maximum_length] =
ValuePool.getLong(distinct.precision);
data[character_octet_length] =
ValuePool.getLong(distinct.precision);
} else if (distinct.isBitType()) {
data[character_maximum_length] =
ValuePool.getLong(distinct.precision);
data[character_octet_length] =
ValuePool.getLong(distinct.precision);
}