[jOOQ/jOOQ#8353] Added a warning when embeddable definitions lack fields

This commit is contained in:
Lukas Eder 2020-08-19 13:19:35 +02:00
parent eb10240431
commit 72c259a48a

View File

@ -1900,6 +1900,11 @@ public abstract class AbstractDatabase implements Database {
if (embeddable.getTables() != null && !matches(patterns.pattern(embeddable.getTables()), table))
continue embeddableLoop;
if (embeddable.getFields().isEmpty()) {
log.warn("Illegal embeddable", "An embeddable definition must have at least one field declaration");
continue embeddableLoop;
}
List<ColumnDefinition> columns = new ArrayList<>();
List<String> names = new ArrayList<>();
@ -1914,7 +1919,6 @@ public abstract class AbstractDatabase implements Database {
matched = columns.add(column) && names.add(defaultIfEmpty(embeddableField.getName(), column.getName()));
}
if (columns.size() == embeddable.getFields().size()) {
CatalogDefinition catalog = getCatalog(embeddable.getCatalog());