@Test public void testGetColumn_Unknown() { DbColumnMetadata c1 = new DbColumnMetadata("c1", Types.INTEGER, false, false); DbTableMetadata md = new DbTableMetadata(TableFQName.forName("x"), new DbColumnMetadata[]{c1}); assertThrows(IllegalArgumentException.class, () -> md.getColumn("no_such_column")); }
public DbColumnMetadata getColumn(String name) { DbColumnMetadata column = columnsByName.get(name); if (column == null) { throw new IllegalArgumentException("Column named '" + name + "' does not exist in table '" + this.name + "'"); } return column; }
DbTableMetadata { public DbColumnMetadata getColumn(String name) { DbColumnMetadata column = columnsByName.get(name); if (column == null) { throw new IllegalArgumentException("Column named '" + name + "' does not exist in table '" + this.name + "'"); } return column; } }
DbTableMetadata { public DbColumnMetadata getColumn(String name) { DbColumnMetadata column = columnsByName.get(name); if (column == null) { throw new IllegalArgumentException("Column named '" + name + "' does not exist in table '" + this.name + "'"); } return column; } DbTableMetadata(TableFQName name, DbColumnMetadata[] columns); }
DbTableMetadata { public DbColumnMetadata getColumn(String name) { DbColumnMetadata column = columnsByName.get(name); if (column == null) { throw new IllegalArgumentException("Column named '" + name + "' does not exist in table '" + this.name + "'"); } return column; } DbTableMetadata(TableFQName name, DbColumnMetadata[] columns); TableFQName getName(); DbColumnMetadata[] getColumns(); String[] getColumnNames(); DbColumnMetadata[] getPkColumns(); boolean hasColumn(String name); DbColumnMetadata getColumn(String name); }
DbTableMetadata { public DbColumnMetadata getColumn(String name) { DbColumnMetadata column = columnsByName.get(name); if (column == null) { throw new IllegalArgumentException("Column named '" + name + "' does not exist in table '" + this.name + "'"); } return column; } DbTableMetadata(TableFQName name, DbColumnMetadata[] columns); TableFQName getName(); DbColumnMetadata[] getColumns(); String[] getColumnNames(); DbColumnMetadata[] getPkColumns(); boolean hasColumn(String name); DbColumnMetadata getColumn(String name);  }