// ********************
// set catalog
if ((tableCatalog != null) && (tableCatalog.trim().length() != 0)) {
// find catalog
Catalog catalog = database.findCatalogByName(tableCatalog);
// set catalog
table.setCatalog(catalog);
// warn if null
if (catalog == 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,
tableCatalog));
}
// if fail is enabled
if (failOnError) {
throw new DatabaseMetaDataMethodException("Catalog name shall be provided", "populateTable");
}
}
// 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)",