[jOOQ/jOOQ#4793] Fix rendering of mapped catalog

This commit is contained in:
Knut Wannheden 2020-01-24 09:51:01 +01:00
parent b5e76e076f
commit da129e2bee
2 changed files with 5 additions and 2 deletions

View File

@ -414,7 +414,9 @@ public class SchemaMapping implements Serializable {
// The configured default schema is mapped to "null". This prevents
// it from being rendered to SQL
if ("".equals(result.getName()) || result.getName().equals(mapping().getDefaultSchema()))
if ("".equals(result.getName())
|| result.getName().equals(mapping().getDefaultSchema())
&& (result.getCatalog() == null || result.getCatalog().getName().equals(mapping().getDefaultCatalog())))
result = null;
return result;

View File

@ -85,7 +85,8 @@ public class CatalogImpl extends AbstractNamed implements Catalog {
@Override
public final void accept(Context<?> ctx) {
ctx.visit(getUnqualifiedName());
Catalog mappedCatalog = Tools.getMappedCatalog(ctx.configuration(), this);
ctx.visit(mappedCatalog != null ? mappedCatalog.getUnqualifiedName() : getUnqualifiedName());
}
@Override