changeset 878:9cf4b2ac3e2a

Allow filtering of columns of any type with IN().
author Tom Gottfried <tom@intevation.de>
date Thu, 11 Feb 2016 16:21:57 +0100
parents 06d1cace9141
children 6bd149c352a9
files src/main/java/de/intevation/lada/util/data/QueryBuilder.java
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/main/java/de/intevation/lada/util/data/QueryBuilder.java	Thu Feb 11 16:19:52 2016 +0100
+++ b/src/main/java/de/intevation/lada/util/data/QueryBuilder.java	Thu Feb 11 16:21:57 2016 +0100
@@ -248,8 +248,8 @@
      *
      * @return The current Querybuilder.
      */
-    public QueryBuilder<T> orIn(String key, List<String> values) {
-        Expression<String> exp = this.root.get(key);
+    public <M> QueryBuilder<T> orIn(String key, List<M> values) {
+        Expression<M> exp = this.root.get(key);
         Predicate p = exp.in(values);
         if (this.filter == null) {
             this.filter = this.builder.or(p);
@@ -269,8 +269,8 @@
      *
      * @return The current Querybuilder.
      */
-    public QueryBuilder<T> andIn(String key, List<String> values) {
-        Expression<String> exp = this.root.get(key);
+    public <M> QueryBuilder<T> andIn(String key, List<M> values) {
+        Expression<M> exp = this.root.get(key);
         Predicate p = exp.in(values);
         if (this.filter == null) {
             this.filter = this.builder.and(p);
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)