}
}
return null;
}
Column column = columnIt.next();
Long precision = null;
Long scale = null;
Long radix = null;
String charset = null;
String collation = null;
if (column.getType().hasAttributes(DecimalAttribute.class)) {
precision = (long) column.getType().attribute(DecimalAttribute.PRECISION);
scale = (long) column.getType().attribute(DecimalAttribute.SCALE);
radix = 10L;
}
Long charMaxLength = null;
Long charOctetLength = null;
if (column.hasCharsetAndCollation()) {
charset = column.getCharsetName().toLowerCase();
collation = column.getCollationName().toLowerCase();
}
if (column.getType().hasAttributes(StringAttribute.class)) {
charMaxLength = (long) column.getType().attribute(StringAttribute.MAX_LENGTH);
charOctetLength = column.getMaxStorageSize() - column.getPrefixSize();
}
else if (column.getType().hasAttributes(TBinary.Attrs.class)) {
charMaxLength = charOctetLength = (long) column.getType().attribute(TBinary.Attrs.LENGTH);
}
String sequenceSchema = null;
String sequenceName = null;
String identityGeneration = null;
long identityStart = 0,
identityIncrement = 0,
identityMin = 0,
identityMax = 0;
String identityCycle = null;
if (column.getIdentityGenerator() != null) {
sequenceSchema = column.getIdentityGenerator().getSequenceName().getSchemaName();
sequenceName = column.getIdentityGenerator().getSequenceName().getTableName();
identityGeneration = column.getDefaultIdentity() ? "BY DEFAULT" : "ALWAYS";
identityStart = column.getIdentityGenerator().getStartsWith();
identityIncrement = column.getIdentityGenerator().getIncrement();
identityMin = column.getIdentityGenerator().getMinValue();
identityMax = column.getIdentityGenerator().getMaxValue();
identityCycle = boolResult(column.getIdentityGenerator().isCycle());
}
String defaultString = null;
if (column.getDefaultValue() != null) {
defaultString = column.getDefaultValue();
}
else if (column.getDefaultFunction() != null) {
defaultString = column.getDefaultFunction() + "()";
}
return new ValuesRow(rowType,
null,
column.getColumnar().getName().getSchemaName(),
column.getColumnar().getName().getTableName(),
column.getName(),
column.getPosition().longValue(),
defaultString,
boolResult(column.getNullable()),
column.getTypeName(),
charMaxLength,
charOctetLength,
precision,
radix,
scale,