TableMetaData table = (TableMetaDataImpl) tableMap.get(column.getQualifiedTableName());
if (table == null) {
// Create table metadata object and add to special references
final Table tableDef = SqlResourceDefinitionUtils.getTable(definition, column);
if (tableDef == null) {
throw new SqlResourceException("Definition requires table element for "
+ column.getTableName() + ", referenced by column " + column.getColumnLabel());
}
table = Factory.getTableMetaData();
table.setAttributes(tableName, qualifiedTableName, databaseName,
TableRole.valueOf(tableDef.getRole()));