From 9be29152cc9dfda0fafbb8bd35359be43bf04239 Mon Sep 17 00:00:00 2001 From: "Greg L. Turnquist" Date: Fri, 18 Mar 2022 16:28:23 -0500 Subject: [PATCH] Use 'lower' for all ignoreCase operations. To avoid having to maintain multiples indices, use 'lower' for all ignoreCase operations (JSqlParser, QueryByExample, Querydsl). See #2420. --- .../springframework/data/jpa/repository/query/QueryUtils.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/springframework/data/jpa/repository/query/QueryUtils.java b/src/main/java/org/springframework/data/jpa/repository/query/QueryUtils.java index 22c92930d1..ec9a05b209 100644 --- a/src/main/java/org/springframework/data/jpa/repository/query/QueryUtils.java +++ b/src/main/java/org/springframework/data/jpa/repository/query/QueryUtils.java @@ -610,8 +610,8 @@ private static javax.persistence.criteria.Order toJpaOrder(Order order, From expression = toExpressionRecursively(from, property); if (order.isIgnoreCase() && String.class.equals(expression.getJavaType())) { - Expression lower = cb.lower((Expression) expression); - return order.isAscending() ? cb.asc(lower) : cb.desc(lower); + Expression upper = cb.lower((Expression) expression); + return order.isAscending() ? cb.asc(upper) : cb.desc(upper); } else { return order.isAscending() ? cb.asc(expression) : cb.desc(expression); }