Skip to content

Commit

Permalink
Issue #2301 - Sorting not honored with JPA and Oracle
Browse files Browse the repository at this point in the history
Signed-off-by: Tomáš Kraus <[email protected]>
  • Loading branch information
Tomas-Kraus committed Nov 22, 2024
1 parent 38f4453 commit 700e208
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1119,8 +1119,16 @@ public void printSQLSelectStatement(DatabaseCall call, ExpressionSQLPrinter prin
printer.printString(primaryKeyFields);
printer.printString(FROM_ID);
printer.printString(queryString);
printer.printString(ORDER_BY_ID);
printer.printString(primaryKeyFields);
if (statement.hasOrderByExpressions()) {
try {
statement.printSQLOrderByClause(printer);
} catch (IOException exception) {
throw ValidationException.fileError(exception);
}
} else {
printer.printString(ORDER_BY_ID);
printer.printString(primaryKeyFields);
}
printer.printString(END_FROM_ID);
printer.printString(MAX_ROW);
printer.printParameter(DatabaseCall.MAXROW_FIELD);
Expand Down

0 comments on commit 700e208

Please sign in to comment.