Mercurial > lada > lada-server
changeset 989:b943e956b767
Complement mandatory fields for messprogramm.
author | Tom Gottfried <tom@intevation.de> |
---|---|
date | Fri, 01 Jul 2016 14:18:00 +0200 |
parents | 5efb32a41b24 |
children | ff07474b65e0 |
files | db_schema/lada_schema.sql src/main/java/de/intevation/lada/validation/rules/messprogramm/HasAllMandatory.java |
diffstat | 2 files changed, 25 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- 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
--- 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