Skip to content

Commit

Permalink
Issue eclipse-ee4j#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 fc24a51 commit 1af78e4
Showing 1 changed file with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2023 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2024 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2023 IBM Corporation. All rights reserved.
*
* This program and the accompanying materials are made available under the
Expand Down Expand Up @@ -1030,8 +1030,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 1af78e4

Please sign in to comment.