public Table addTable(String name) throws IllegalArgumentException { String physicalName = dialect.getTableName(name); if (!physicalTables.add(physicalName)) { throw new IllegalArgumentException("Duplicate table name: " + physicalName); } Table table = new TableImpl(dialect, physicalName, name); tables.put(name, table); return table; }
public static Table addTable(String name, Dialect dialect, boolean nativeCase) { String physicalName = dialect.getTableName(name); if (!nativeCase && name.length() == physicalName.length()) { // we can keep the name specified in the config physicalName = name; } return new TableImpl(dialect, physicalName, physicalName); }
protected void getTable(Connection connection, String tbl) throws SQLException { String tablePhysicalName = dialect.getTableName(tbl); table = new TableImpl(dialect, tablePhysicalName, tablePhysicalName); keyCol = addColumn(KEY_COL, ColumnType.SYSNAME); keyCol.setPrimary(true); keyCol.setNullable(false); longCol = addColumn(LONG_COL, ColumnType.LONG); stringCol = addColumn(STRING_COL, ColumnType.CLOB); bytesCol = addColumn(BYTES_COL, ColumnType.BLOB); ttlCol = addColumn(TTL_COL, ColumnType.LONG); table.addIndex(TTL_COL); tableName = table.getQuotedName(); keyColName = keyCol.getQuotedName(); longColName = longCol.getQuotedName(); stringColName = stringCol.getQuotedName(); bytesColName = bytesCol.getQuotedName(); ttlColName = ttlCol.getQuotedName(); if (!tableExists(connection)) { createTable(connection); } checkColumns(connection); }