[jOOQ/jOOQ#18543] Open up utility function to OSS edition

This commit is contained in:
Lukas Eder 2025-05-28 15:13:52 +02:00
parent f47010666e
commit 8f2e2d3385
2 changed files with 17 additions and 17 deletions

View File

@ -4203,24 +4203,24 @@ final class Tools {
static final Select<?> extractSelectFromDerivedTable(Table<?> table) {
return extractSelectFromDerivedTable(table, false);
}
private static final Select<?> extractSelectFromDerivedTable(Table<?> table, boolean force) {
Table<?> aliased;
if (table instanceof DerivedTable<?> t)
return t.query();
else if (table instanceof AliasedSelect<?> s)
return s.query();
else if ((aliased = aliased(table)) != null)
return extractSelectFromDerivedTable(aliased, true);
else if (force)
return select(asterisk()).from(table);
else
return null;
}
@SuppressWarnings({ "unchecked", "rawtypes" })
static final <R extends Record> SelectQueryImpl<R> selectQueryImpl(QueryPart part) {

View File

@ -74,7 +74,7 @@ import static org.jooq.impl.Names.N_OFFSET;
import static org.jooq.impl.Names.N_ORDINAL;
import static org.jooq.impl.SQLDataType.BIGINT;
import static org.jooq.impl.SubqueryCharacteristics.DERIVED_TABLE;
// ...
import static org.jooq.impl.Tools.extractSelectFromDerivedTable;
import static org.jooq.impl.Tools.visitSubquery;
import static org.jooq.impl.Tools.BooleanDataKey.DATA_FORCE_LIMIT_WITH_ORDER_BY;