Skip to content

Commit

Permalink
Use 'lower' for all ignoreCase operations.
Browse files Browse the repository at this point in the history
To avoid having to maintain multiples indices, use 'lower' for all ignoreCase operations (JSqlParser, QueryByExample, Querydsl).

See #2420.
  • Loading branch information
gregturn committed Mar 22, 2022
1 parent aa52ffe commit 9be2915
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -610,8 +610,8 @@ private static javax.persistence.criteria.Order toJpaOrder(Order order, From<?,
Expression<?> expression = toExpressionRecursively(from, property);

if (order.isIgnoreCase() && String.class.equals(expression.getJavaType())) {
Expression<String> lower = cb.lower((Expression<String>) expression);
return order.isAscending() ? cb.asc(lower) : cb.desc(lower);
Expression<String> upper = cb.lower((Expression<String>) expression);
return order.isAscending() ? cb.asc(upper) : cb.desc(upper);
} else {
return order.isAscending() ? cb.asc(expression) : cb.desc(expression);
}
Expand Down

0 comments on commit 9be2915

Please sign in to comment.