package org.jboss.test.cmp2.dbschema.util;
import java.util.Map;
public class Table
{
private final String table;
private final Map columnsByName;
public Table(String table, Map columnsByName)
{
this.table = table;
this.columnsByName = columnsByName;
}
public Column getColumn(String name) throws Exception
{
Column column = (Column)columnsByName.get(name);
if(column == null)
throw new Exception("Column " + name + " not found in table " + table);
return column;
}
public int getColumnsNumber()
{
return columnsByName.size();
}
}