/** * Create a new table in this database * @param name Name of the table to create * @param columns List of Columns in the table * @param indexes List of IndexBuilders describing indexes for the table * @deprecated use {@link TableBuilder} instead */ @Deprecated public void createTable(String name, List<ColumnBuilder> columns, List<IndexBuilder> indexes) throws IOException { new TableBuilder(name) .addColumns(columns) .addIndexes(indexes) .toTable(this); }
/** * Returns a new table with a unique name and the given table definition. */ private static Table createUniqueTable(Database db, String name, List<ColumnBuilder> columns, ResultSetMetaData md, ImportFilter filter) throws IOException, SQLException { // otherwise, find unique name and create new table String baseName = name; int counter = 2; while(db.getTable(name) != null) { name = baseName + (counter++); } return new TableBuilder(name) .addColumns(filter.filterColumns(columns, md)) .toTable(db); }
int idTable = mtd.newTable(tn, ntn, Metadata.Types.TABLE); Collection<ColumnBuilder> lcb = getColumns(ntn, columnMap, types); tb.addColumns(lcb); int colIdx = 0; for (ColumnBuilder cb : lcb) {