[Lada-commits] [PATCH 14 of 15] Make 'and-/or like' operations case insensitive

Wald Commits scm-commit at wald.intevation.org
Mon Mar 23 18:00:06 CET 2015


# HG changeset patch
# User Raimund Renkert <raimund.renkert at intevation.de>
# Date 1427129702 -3600
# Node ID f17c0e685c47f3f9e67ed4315944314271ff1ee8
# Parent  6de05718ac8d208abb98581ba36b78a6016b7409
Make 'and-/or like' operations case insensitive

diff -r 6de05718ac8d -r f17c0e685c47 src/main/java/de/intevation/lada/util/data/QueryBuilder.java
--- a/src/main/java/de/intevation/lada/util/data/QueryBuilder.java	Mon Mar 23 17:53:47 2015 +0100
+++ b/src/main/java/de/intevation/lada/util/data/QueryBuilder.java	Mon Mar 23 17:55:02 2015 +0100
@@ -83,7 +83,7 @@
      */
     public QueryBuilder<T> andLike(String id, String value) {
         Path<String> path = this.root.get(id);
-        Predicate p = this.builder.like(path, value);
+        Predicate p = this.builder.like(this.builder.lower(path), value);
         if (this.filter != null) {
             this.filter = this.builder.and(this.filter, p);
         }
@@ -120,7 +120,7 @@
      */
     public QueryBuilder<T> orLike(String id, String value) {
         Path<String> path = this.root.get(id);
-        Predicate p = this.builder.like(path, value);
+        Predicate p = this.builder.like(this.builder.lower(path), value);
         if (this.filter != null) {
             this.filter = this.builder.or(this.filter, p);
         }


More information about the Lada-commits mailing list