}
// set schema
if ((tableSchema != null) && (tableSchema.trim().length() != 0)) {
// find schema
Schema schema = database.findSchemaByName(tableCatalog, tableSchema);
// set schema
table.setSchema(schema);
// warn if null
if (schema == null) {
traceLog.debug(String.format("[Database %s] Unable to find schema '%3$s' for the table %s (schema %s, catalog %s)",
database.getName(),
tableName,
tableSchema,
tableCatalog));
}
// if fail is enabled
if (failOnError) {
throw new DatabaseMetaDataMethodException("Table name shall be provided", "populateTable");
}
}
// **************
// *** Table ***
// **************
// set table type
if (tableTypeName != null) {
// create
TableType tableType = factory.createTableType();
// fill
tableType.setName(tableTypeName);
// set type
table.setTableType(tableType);
}
// set catalog
if ((typeCatalogName != null) && (typeCatalogName.trim().length() != 0)) {
// find catalog
Catalog typeCatalog = database.findCatalogByName(typeCatalogName);
// set type catalog
table.setTypeCatalog(typeCatalog);
// warn if null
if (typeCatalog == null) {
traceLog.debug(String.format("[Database %s] Unable to find catalog '%4$s' for the table %s (schema %s, catalog %s)",
database.getName(),
tableName,
tableSchema,
typeCatalogName));
}
}
// set schema
if ((typeSchemaName != null) && (typeSchemaName.trim().length() != 0)) {
// find schema
Schema typeSchema = database.findSchemaByName(typeCatalogName, typeSchemaName);
// set schema
table.setTypeSchema(typeSchema);
// warn if null
if (typeSchema == null) {
traceLog.debug(String.format("[Database %s] Unable to find schema '%3$s' for the table %s (schema %s, catalog %s)",