String scopeTable = getString(resultSet, "SCOPE_TABLE", false);
// sourceDataType
Integer sourceDataType = getInteger(resultSet, "SOURCE_DATA_TYPE", false);
// create table column object
TableColumn column = factory.createTableColumn();
// ***************************************
// *** DatabaseNamedObject properties ***
// ***************************************
// name
column.setName(columnName);
// remarks
column.setRemarks(remarks);
// TODO set extra properties
// column.addExtraProperty (String key, Object value);
// ***************
// *** Column ***
// ***************
// owner
column.setOwner(table);
// 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); //
// ********************
// *** Table Column ***
// ********************
// pseudo type
column.setPseudoType(ColumnPseudoType.NOT_PSEUDO);
// 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 column to the table
table.addColumn(column);