[jOOQ/jOOQ#10540] Implement new internal syntax to create derived column

lists only if necessary

- Applied optimisation to QuantifiedComparisonCondition
This commit is contained in:
Lukas Eder 2020-08-27 15:50:27 +02:00
parent 99ea335783
commit e3e21f5037

View File

@ -187,7 +187,9 @@ final class QuantifiedComparisonCondition extends AbstractCondition implements L
throw new IllegalStateException();
}
Table<?> t = (query.array != null ? new ArrayTable(query.array) : query.query).asTable("t", "pattern");
Table<?> t = query.array != null
? new ArrayTable(query.array).asTable("t", "pattern")
: new AliasedSelect<>(query.query, name("pattern")).as("t");
Select<Record1<Boolean>> select = select(DSL.field(cond)).from(t);
ctx.visit(lhs.eq(query.quantifier.apply(select)));
}