[Lada-commits] [PATCH] Removed column 'query_id' from filter_value table

Wald Commits scm-commit at wald.intevation.org
Fri Feb 19 14:24:08 CET 2016


# HG changeset patch
# User Raimund Renkert <raimund.renkert at intevation.de>
# Date 1455888238 -3600
# Node ID d4d7682950680cc0a97f4116fab20273f72e6add
# Parent  dec1e63a2ffe347d3f70caa88632a14822553f1d
Removed column 'query_id' from filter_value table.

diff -r dec1e63a2ffe -r d4d768295068 db_schema/stammdaten_schema.sql
--- a/db_schema/stammdaten_schema.sql	Fri Feb 19 14:00:17 2016 +0100
+++ b/db_schema/stammdaten_schema.sql	Fri Feb 19 14:23:58 2016 +0100
@@ -272,7 +272,6 @@
 
 CREATE TABLE filter_value (
     id integer PRIMARY KEY DEFAULT nextval('filter_value_id_seq'::regclass),
-    query_id integer NOT NULL,
     user_id integer NOT NULL,
     filter_id integer NOT NULL,
     value text
@@ -856,11 +855,6 @@
 
 
 ALTER TABLE ONLY filter_value
-    ADD CONSTRAINT filter_value_query_id_fkey FOREIGN KEY (query_id) REFERENCES query(id);
-
-
-
-ALTER TABLE ONLY filter_value
     ADD CONSTRAINT filter_value_user_id_fkey FOREIGN KEY (user_id) REFERENCES lada_user(id);
 
 
diff -r dec1e63a2ffe -r d4d768295068 src/main/java/de/intevation/lada/model/stamm/FilterValue.java
--- a/src/main/java/de/intevation/lada/model/stamm/FilterValue.java	Fri Feb 19 14:00:17 2016 +0100
+++ b/src/main/java/de/intevation/lada/model/stamm/FilterValue.java	Fri Feb 19 14:23:58 2016 +0100
@@ -43,9 +43,6 @@
     @Column(name="user_id")
     private Integer userId;
 
-    @Column(name="query_id")
-    private Integer queryId;
-
     public FilterValue() {
     }
 
@@ -80,12 +77,4 @@
     public void setUserId(Integer userId) {
         this.userId = userId;
     }
-
-    public Integer getQueryId() {
-        return this.queryId;
-    }
-
-    public void setQueryId(Integer queryId) {
-        this.queryId = queryId;
-    }
 }
diff -r dec1e63a2ffe -r d4d768295068 src/main/java/de/intevation/lada/rest/stamm/FilterService.java
--- a/src/main/java/de/intevation/lada/rest/stamm/FilterService.java	Fri Feb 19 14:00:17 2016 +0100
+++ b/src/main/java/de/intevation/lada/rest/stamm/FilterService.java	Fri Feb 19 14:23:58 2016 +0100
@@ -60,12 +60,10 @@
         );
         builder.and("userId", userInfo.getUserId());
         builder.and("filterId", f.getId());
-        builder.and("queryId", f.getQuery().getId());
         List<FilterValue> values = repository.filterPlain(builder.getQuery(), "stamm");
         if (values == null || values.isEmpty()) {
             FilterValue newValue = new FilterValue();
             newValue.setFilterId(f.getId());
-            newValue.setQueryId(f.getQuery().getId());
             newValue.setUserId(userInfo.getUserId());
             newValue.setValue(value);
             repository.create(newValue, "stamm");
@@ -97,7 +95,6 @@
         );
         builder.and("userId", userInfo.getUserId());
         builder.and("filterId", f.getId());
-        builder.and("queryId", f.getQuery().getId());
         List<FilterValue> values = repository.filterPlain(builder.getQuery(), "stamm");
         if (values == null || values.isEmpty()) {
             return new Response(false, 618, "not existing");
@@ -106,7 +103,6 @@
         QueryBuilder<FilterValue> fvBuilder = builder.getEmptyBuilder();
         fvBuilder.and("userId", 0);
         fvBuilder.and("filterId", f.getId());
-        fvBuilder.and("queryId", f.getQuery().getId());
         List<FilterValue> basicValues = repository.filterPlain(fvBuilder.getQuery(), "stamm");
         if (basicValues == null || basicValues.isEmpty()) {
             f.setValue(null);
diff -r dec1e63a2ffe -r d4d768295068 src/main/java/de/intevation/lada/rest/stamm/QueryService.java
--- a/src/main/java/de/intevation/lada/rest/stamm/QueryService.java	Fri Feb 19 14:00:17 2016 +0100
+++ b/src/main/java/de/intevation/lada/rest/stamm/QueryService.java	Fri Feb 19 14:23:58 2016 +0100
@@ -169,7 +169,6 @@
         );
         builder.and("userId", userId);
         for (Query q : queries) {
-            builder.and("queryId", q.getId());
             List<FilterValue> values = repository.filterPlain(builder.getQuery(), "stamm");
             for (Filter f : q.getFilters()) {
                 for (FilterValue fv : values) {


More information about the Lada-commits mailing list