[jOOQ/jOOQ#16409] Move some logic to OSS edition

This commit is contained in:
Lukas Eder 2025-01-17 08:56:06 +01:00
parent 46c0a3760f
commit 4c8c03fc84
4 changed files with 28 additions and 44 deletions

View File

@ -823,13 +823,6 @@ abstract class AbstractDMLQuery<R extends Record> extends AbstractRowCountQuery
@ -1351,6 +1344,12 @@ abstract class AbstractDMLQuery<R extends Record> extends AbstractRowCountQuery
log.debug("RETURNING was set on query, but no rows were returned. This is likely due to a missing identity column (or an identity column unknown to jOOQ).");
}
/**
* The estimated number of affected rows, {@link Integer#MAX_VALUE}, if
* unknown.
*/
abstract int estimatedRowCount(Scope ctx);
private final int executeReturningGeneratedKeys(ExecuteContext ctx, ExecuteListener listener) throws SQLException {
listener.executeStart(ctx);
int result = executeImmediate(ctx.statement()).executeUpdate();

View File

@ -597,15 +597,10 @@ implements
return super.isExecutable();
}
@Override
final int estimatedRowCount(Scope ctx) {
return Integer.MAX_VALUE;
}
// -------------------------------------------------------------------------
// XXX: Query Object Model

View File

@ -1197,6 +1197,17 @@ implements
return insertMaps.isExecutable() || defaultValues(configuration()) || select != null;
}
@Override
final int estimatedRowCount(Scope ctx) {
if (defaultValues(ctx.configuration()))
return 1;
else if (select != null)
return Integer.MAX_VALUE;
// [#2682] [#15632] Inline derived tables (and policies) may generate a SELECT
else if (InlineDerivedTable.inlineDerivedTable(ctx, table(ctx)) instanceof InlineDerivedTable)
return Integer.MAX_VALUE;
@ -1205,24 +1216,9 @@ implements
else
return insertMaps.rows;
}
// -------------------------------------------------------------------------
// XXX: Query Object Model

View File

@ -931,16 +931,10 @@ implements
return updateMap.size() > 0;
}
@Override
final int estimatedRowCount(Scope ctx) {
return Integer.MAX_VALUE;
}
// -------------------------------------------------------------------------
// XXX: Query Object Model