@Override protected String getDefaultSchemaName() { return _schema.getName(); }
private static ImmutableTable getSimilarTable(Table table, ImmutableSchema schema) { String name = table.getName(); return (ImmutableTable) schema.getTableByName(name); }
_schema = new ImmutableSchema(schema);
@Override protected Schema getMainSchema() throws MetaModelException { final MutableSchema schema = new MutableSchema(getMainSchemaName()); for (XmlSaxTableDef tableDef : _tableDefs) { final String rowXpath = tableDef.getRowXpath(); final MutableTable table = new MutableTable(getTableName(tableDef)).setSchema(schema).setRemarks("XPath: " + rowXpath); final MutableColumn rowIndexColumn = new MutableColumn(COLUMN_NAME_ROW_ID, ColumnType.INTEGER) .setColumnNumber(0).setNullable(false).setTable(table).setRemarks("Row/tag index (0-based)"); table.addColumn(rowIndexColumn); for (String valueXpath : tableDef.getValueXpaths()) { final MutableColumn column = new MutableColumn(getName(tableDef, valueXpath)).setRemarks("XPath: " + valueXpath); if (valueXpath.startsWith("index(") && valueXpath.endsWith(")")) { column.setType(ColumnType.INTEGER); } else { column.setType(ColumnType.STRING); } column.setTable(table); table.addColumn(column); } schema.addTable(table); } return new ImmutableSchema(schema); }
private static ImmutableTable getSimilarTable(Table table, ImmutableSchema schema) { String name = table.getName(); return (ImmutableTable) schema.getTableByName(name); }