Use 'lower' for all ignoreCase operations.

To avoid having to maintain multiples indices, use 'lower' for all ignoreCase operations (JSqlParser, QueryByExample, Querydsl).

See #2420.
This commit is contained in:
Greg L. Turnquist
2022-03-18 16:28:23 -05:00
parent 6b27459b5b
commit 15e8e3bfe8

View File

@@ -610,8 +610,8 @@ public abstract class QueryUtils {
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);
}