Skip to content

Commit

Permalink
fix native queries order by
Browse files Browse the repository at this point in the history
  • Loading branch information
balsarori authored and vrmoreira committed Apr 22, 2024
1 parent 43333e4 commit 358efa0
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,8 @@ public Object execute(CommandContext commandContext) {
parameterMap.put("resultType", "LIST_PAGE");
parameterMap.put("firstResult", firstResult);
parameterMap.put("maxResults", maxResults);
if (StringUtils.isNotBlank(Objects.toString(parameterMap.get("orderBy")))) {
parameterMap.put("orderByColumns", "RES." + parameterMap.get("orderBy"));
} else {
parameterMap.put("orderByColumns", "RES.ID_ asc");
}
Object orderBy = parameterMap.getOrDefault("orderBy", "ID_ asc");
parameterMap.put("orderByColumns", "RES." + orderBy);

int firstRow = firstResult + 1;
parameterMap.put("firstRow", firstRow);
Expand Down

0 comments on commit 358efa0

Please sign in to comment.