/**
* Create a column with the given attributes.
*/
private Column parseColumn(Attributes attrs)
throws SAXException {
Column col = new Column();
String val = attrs.getValue("name");
if (val != null)
col.setIdentifier(DBIdentifier.newColumn(val, delimit()));
val = attrs.getValue("referenced-column-name");
if (val != null) {
setTargetIdentifier(col, val);
}
val = attrs.getValue("column-definition");
if (val != null)
col.setTypeIdentifier(DBIdentifier.newColumnDefinition(val));
val = attrs.getValue("precision");
if (val != null)
col.setSize(Integer.parseInt(val));
val = attrs.getValue("length");
if (val != null)
col.setSize(Integer.parseInt(val));
val = attrs.getValue("scale");
if (val != null)
col.setDecimalDigits(Integer.parseInt(val));
val = attrs.getValue("nullable");
if (val != null)
col.setNotNull("false".equals(val));
val = attrs.getValue("insertable");
if (val != null)
col.setFlag(Column.FLAG_UNINSERTABLE, "false".equals(val));
val = attrs.getValue("updatable");
if (val != null)
col.setFlag(Column.FLAG_UNUPDATABLE, "false".equals(val));
val = attrs.getValue("unique");
if (val != null)
_unique.add(Enum.valueOf(UniqueFlag.class, val.toUpperCase()));
val = attrs.getValue("table");