String scopeTable = getString(resultSet, "SCOPE_TABLE", false);
// sourceDataType
Integer sourceDataType = getInteger(resultSet, "SOURCE_DATA_TYPE", false);
// create UDT attribute object
Attribute column = factory.createAttribute();
// ***************************************
// *** DatabaseNamedObject properties ***
// ***************************************
// name
column.setName(columnName);
// remarks
column.setRemarks(remarks);
// TODO set extra properties
// column.addExtraProperty (String key, Object value);
// ***************
// *** Column ***
// ***************
// owner
column.setOwner(udt);
// nullability. The isNullableString is not used so far
column.setNullabilityType(getNullabilityType(nullableType));
// SQL type
column.setSqlType(getSqlType(dataType));
// type name
column.setTypeName(typeName);
// Size
column.setSize(size);
// precision
column.setPrecision(precision);
// Radix
column.setRadix(radix);
// DefaultValue
column.setDefaultValue(defaultValue);
// OrdinalPosition
column.setOrdinalPosition(ordinalPosition);
// CharOctetLength
column.setCharOctetLength(charOctetLength);
// addPrivilege
// column.addPrivilege (privilege); //
// ********************
// *** Attribute ***
// ********************
// set reference
if ((scopeCatalog != null) || (scopeSchema != null) || (scopeTable != null) || (sourceDataType != null)) {
// create reference
Reference reference = factory.createReference();
// set Source Data Type
reference.setSourceDataType(getSqlType(sourceDataType));
// find table and set as source
reference.setSourceTable(database.findTableByName(scopeCatalog, scopeSchema, scopeTable));
// set reference
column.setReference(reference);
}
// add attribute to the UDT
udt.addAttribute(column);