Skip to content

Commit

Permalink
Refactor order clause generation using Stream API.
Browse files Browse the repository at this point in the history
Closes #3611
  • Loading branch information
Seol-JY authored Oct 11, 2024
1 parent f045352 commit ddc9914
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -292,11 +292,11 @@ public static String applySorting(String query, Sort sort, @Nullable String alia
Set<String> selectionAliases = getFunctionAliases(query);
selectionAliases.addAll(getFieldAliases(query));

for (Order order : sort) {
builder.append(getOrderClause(joinAliases, selectionAliases, alias, order)).append(", ");
}
String orderClauses = sort.stream()
.map(order -> getOrderClause(joinAliases, selectionAliases, alias, order))
.collect(Collectors.joining(", "));

builder.delete(builder.length() - 2, builder.length());
builder.append(orderClauses);

return builder.toString();
}
Expand Down

0 comments on commit ddc9914

Please sign in to comment.