changeset 891:d4d768295068

Removed column 'query_id' from filter_value table.
author Raimund Renkert <raimund.renkert@intevation.de>
date Fri, 19 Feb 2016 14:23:58 +0100
parents dec1e63a2ffe
children 4b7f62a63297
files db_schema/stammdaten_schema.sql src/main/java/de/intevation/lada/model/stamm/FilterValue.java src/main/java/de/intevation/lada/rest/stamm/FilterService.java src/main/java/de/intevation/lada/rest/stamm/QueryService.java
diffstat 4 files changed, 0 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- 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);
 
 
--- 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;
-    }
 }
--- 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);
--- 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) {
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)