Node root = tableTree.getRoot();
return addTableDefinition(root);
}
private boolean addTableDefinition(Node node) {
DatabaseObject table = node.getTable();
String tableName = getTableName(table);
if (tableName == null) {
return false;
}
xsd.addElement("element");
String sanitizedName = sanitizeName(tableName);
xsd.addAttribute("name", sanitizedName);
applyCardinality(node.getCardinality());
xsd.addElement("complexType");
xsd.addElement("sequence");
for (DatabaseColumn column : table.getAllColumns()) {
addColumnDefinition(column);
}
for (Node child : node.getChildren()) {
// No need to check the return value, since only the root table can result
// in false being returned (for a manual sql statement).