[Lada-commits] [PATCH] Complement mandatory fields for messprogramm

Wald Commits scm-commit at wald.intevation.org
Fri Jul 1 14:18:44 CEST 2016


# HG changeset patch
# User Tom Gottfried <tom at intevation.de>
# Date 1467375480 -7200
# Node ID b943e956b76714b47e660b9c929203b2b6c05b77
# Parent  5efb32a41b24c094274ad82bd3249a7ecdcc0fd6
Complement mandatory fields for messprogramm.

diff -r 5efb32a41b24 -r b943e956b767 db_schema/lada_schema.sql
--- a/db_schema/lada_schema.sql	Fri Jul 01 10:32:44 2016 +0200
+++ b/db_schema/lada_schema.sql	Fri Jul 01 14:18:00 2016 +0200
@@ -575,16 +575,16 @@
     datenbasis_id integer NOT NULL REFERENCES stammdaten.datenbasis,
     ba_id character varying(1),
     gem_id character varying(8),
-    ort_id integer REFERENCES stammdaten.ort,
+    ort_id integer NOT NULL REFERENCES stammdaten.ort,
     media_desk character varying(100),
     umw_id character varying(3) REFERENCES stammdaten.umwelt,
     probenart_id integer NOT NULL REFERENCES stammdaten.probenart,
-    probenintervall character varying(2),
-    teilintervall_von integer,
-    teilintervall_bis integer,
+    probenintervall character varying(2) NOT NULL,
+    teilintervall_von integer NOT NULL,
+    teilintervall_bis integer NOT NULL,
     intervall_offset integer,
-    gueltig_von integer,
-    gueltig_bis integer,
+    gueltig_von integer NOT NULL,
+    gueltig_bis integer NOT NULL,
     probe_nehmer_id integer,
     probe_kommentar character varying(80),
     letzte_aenderung timestamp without time zone DEFAULT now() NOT NULL
diff -r 5efb32a41b24 -r b943e956b767 src/main/java/de/intevation/lada/validation/rules/messprogramm/HasAllMandatory.java
--- a/src/main/java/de/intevation/lada/validation/rules/messprogramm/HasAllMandatory.java	Fri Jul 01 10:32:44 2016 +0200
+++ b/src/main/java/de/intevation/lada/validation/rules/messprogramm/HasAllMandatory.java	Fri Jul 01 14:18:00 2016 +0200
@@ -42,6 +42,25 @@
         if (messprogramm.getProbenartId() == null) {
             violation.addError("probenartId", 631);
         }
+        if (messprogramm.getProbenintervall() == null
+            | "".equals(messprogramm.getProbenintervall())) {
+            violation.addError("probenintervall", 631);
+        }
+        if (messprogramm.getTeilintervallVon() == null) {
+            violation.addError("teilintervallVon", 631);
+        }
+        if (messprogramm.getTeilintervallBis() == null) {
+            violation.addError("teilintervallBis", 631);
+        }
+        if (messprogramm.getGueltigVon() == null) {
+            violation.addError("gueltigVon", 631);
+        }
+        if (messprogramm.getGueltigBis() == null) {
+            violation.addError("gueltigBis", 631);
+        }
+        if (messprogramm.getOrtId() == null) {
+            violation.addError("ortId", 631);
+        }
 
         return violation.hasErrors()
             ? violation


More information about the Lada-commits mailing list