[#6644] Improve "no catalogs were loaded" error message

This commit is contained in:
lukaseder 2017-10-09 11:43:03 +02:00
parent 5b32938b61
commit 45320b2623

View File

@ -389,18 +389,28 @@ public abstract class AbstractDatabase implements Database {
log.error("Could not load catalogs", e);
}
boolean onlyDefaultCatalog = true;
Iterator<CatalogDefinition> it = catalogs.iterator();
while (it.hasNext()) {
CatalogDefinition catalog = it.next();
if (!StringUtils.isBlank(catalog.getName()))
onlyDefaultCatalog = false;
if (!getInputCatalogs().contains(catalog.getName()))
it.remove();
}
if (catalogs.isEmpty())
log.warn(
"No catalogs were loaded",
"Please check your connection settings, and whether your database (and your database version!) is really supported by jOOQ. Also, check the case-sensitivity in your configured <inputCatalog/> elements.");
if (onlyDefaultCatalog)
log.warn(
"No catalogs were loaded",
"Your database reported only a default catalog, which was filtered by your <inputCatalog/> configurations. jOOQ does not support catalogs for all databases, in case of which <inputCatalog/> configurations will not work.");
else
log.warn(
"No catalogs were loaded",
"Please check your connection settings, and whether your database (and your database version!) is really supported by jOOQ. Also, check the case-sensitivity in your configured <inputCatalog/> elements.");
}
return catalogs;