/** * Constructs a {@link SimpleTableDef} using a {@link Table} as a prototype. * * @param table */ public SimpleTableDef(Table table) { _name = table.getName(); _columnNames = new String[table.getColumnCount()]; _columnTypes = new ColumnType[table.getColumnCount()]; for (int i = 0; i < table.getColumnCount(); i++) { Column column = table.getColumn(i); _columnNames[i] = column.getName(); _columnTypes[i] = column.getType(); } }
/** * Constructs a {@link SimpleTableDef} using a {@link Table} as a prototype. * * @param table */ public SimpleTableDef(Table table) { _name = table.getName(); _columnNames = new String[table.getColumnCount()]; _columnTypes = new ColumnType[table.getColumnCount()]; for (int i = 0; i < table.getColumnCount(); i++) { Column column = table.getColumn(i); _columnNames[i] = column.getName(); _columnTypes[i] = column.getType(); } }
private SimpleTableDef createTableDef(final Table table) { final int columnCount = table.getColumnCount(); final String[] names = new String[columnCount]; final ColumnType[] types = new ColumnType[columnCount]; for (int i = 0; i < columnCount; i++) { names[i] = table.getColumn(i).getName(); types[i] = table.getColumn(i).getType(); } return new SimpleTableDef(table.getName(), names, types); }