[Lada-commits] [PATCH 3 of 4] Added logical or for integer lists

Wald Commits scm-commit at wald.intevation.org
Wed Jul 8 09:42:32 CEST 2015


# HG changeset patch
# User Raimund Renkert <raimund.renkert at intevation.de>
# Date 1436341307 -7200
# Node ID ca536cd501207728552b598807005c33ae6ba9f3
# Parent  ae33fdecd9e2d5452c16cdc2cdf7065c5ebfdb56
Added logical or for integer lists.

diff -r ae33fdecd9e2 -r ca536cd50120 src/main/java/de/intevation/lada/util/data/QueryBuilder.java
--- a/src/main/java/de/intevation/lada/util/data/QueryBuilder.java	Tue Jul 07 11:58:46 2015 +0200
+++ b/src/main/java/de/intevation/lada/util/data/QueryBuilder.java	Wed Jul 08 09:41:47 2015 +0200
@@ -180,6 +180,21 @@
     }
 
     /**
+     * Logical OR operation.
+     * All elements in <i>values</i> will be concatenated with OR operator.
+     *
+     * @param id        The database column name.
+     * @param values    List of values.
+     * @return The builder itself.
+     */
+    public QueryBuilder<T> orIntList(String id, List<Integer> values) {
+        for (Integer v: values) {
+            this.or(id, v);
+        }
+        return this;
+    }
+
+    /**
      * Logical AND operation.
      * The actually defined query will be concatenated with the query defined
      * in the builder <i>b</i>.


More information about the Lada-commits mailing list