changeset 949:2c927b3edb97

Return correct response if update failed.
author Tom Gottfried <tom@intevation.de>
date Tue, 24 May 2016 11:46:17 +0200
parents c9b84bca3e3d
children 0929503c2c79
files src/main/java/de/intevation/lada/rest/MessprogrammMmtService.java src/main/java/de/intevation/lada/rest/MessprogrammService.java src/main/java/de/intevation/lada/rest/MessungService.java src/main/java/de/intevation/lada/rest/MesswertService.java src/main/java/de/intevation/lada/rest/OrtService.java src/main/java/de/intevation/lada/rest/ProbeService.java src/main/java/de/intevation/lada/rest/ZusatzwertService.java
diffstat 7 files changed, 21 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/main/java/de/intevation/lada/rest/MessprogrammMmtService.java	Mon May 23 15:49:30 2016 +0200
+++ b/src/main/java/de/intevation/lada/rest/MessprogrammMmtService.java	Tue May 24 11:46:17 2016 +0200
@@ -219,6 +219,9 @@
         }
         messprogrammmmt.setLetzteAenderung(new Timestamp(new Date().getTime()));
         Response response = defaultRepo.update(messprogrammmmt, "land");
+        if (!response.getSuccess()) {
+            return response;
+        }
         Response updated = defaultRepo.getById(
             MessprogrammMmt.class,
             ((MessprogrammMmt)response.getData()).getId(), "land");
--- a/src/main/java/de/intevation/lada/rest/MessprogrammService.java	Mon May 23 15:49:30 2016 +0200
+++ b/src/main/java/de/intevation/lada/rest/MessprogrammService.java	Tue May 24 11:46:17 2016 +0200
@@ -298,6 +298,9 @@
             messprogramm = factory.findUmweltId(messprogramm);
         }
         Response response = defaultRepo.update(messprogramm, "land");
+        if (!response.getSuccess()) {
+            return response;
+        }
         Response updated = defaultRepo.getById(
             Messprogramm.class,
             ((Messprogramm)response.getData()).getId(), "land");
--- a/src/main/java/de/intevation/lada/rest/MessungService.java	Mon May 23 15:49:30 2016 +0200
+++ b/src/main/java/de/intevation/lada/rest/MessungService.java	Tue May 24 11:46:17 2016 +0200
@@ -378,6 +378,9 @@
             return response;
         }
         Response response = repository.update(messung, "land");
+        if (!response.getSuccess()) {
+            return response;
+        }
         Response updated = repository.getById(
             LMessung.class,
             ((LMessung)response.getData()).getId(), "land");
--- a/src/main/java/de/intevation/lada/rest/MesswertService.java	Mon May 23 15:49:30 2016 +0200
+++ b/src/main/java/de/intevation/lada/rest/MesswertService.java	Tue May 24 11:46:17 2016 +0200
@@ -332,6 +332,9 @@
         }
 
         Response response = defaultRepo.update(messwert, "land");
+        if (!response.getSuccess()) {
+            return response;
+        }
         Response updated = defaultRepo.getById(
             LMesswert.class,
             ((LMesswert)response.getData()).getId(), "land");
--- a/src/main/java/de/intevation/lada/rest/OrtService.java	Mon May 23 15:49:30 2016 +0200
+++ b/src/main/java/de/intevation/lada/rest/OrtService.java	Tue May 24 11:46:17 2016 +0200
@@ -288,6 +288,9 @@
 
         ort.setLetzteAenderung(new Timestamp(new Date().getTime()));
         Response response = defaultRepo.update(ort, "land");
+        if (!response.getSuccess()) {
+            return response;
+        }
         Response updated = defaultRepo.getById(
             LOrtszuordnung.class,
             ((LOrtszuordnung)response.getData()).getId(), "land");
--- a/src/main/java/de/intevation/lada/rest/ProbeService.java	Mon May 23 15:49:30 2016 +0200
+++ b/src/main/java/de/intevation/lada/rest/ProbeService.java	Tue May 24 11:46:17 2016 +0200
@@ -446,6 +446,9 @@
             factory.findUmweltId(probe);
         }
         Response response = repository.update(probe, "land");
+        if (!response.getSuccess()) {
+            return response;
+        }
         Response updated = repository.getById(
             LProbe.class,
             ((LProbe)response.getData()).getId(), "land");
--- a/src/main/java/de/intevation/lada/rest/ZusatzwertService.java	Mon May 23 15:49:30 2016 +0200
+++ b/src/main/java/de/intevation/lada/rest/ZusatzwertService.java	Tue May 24 11:46:17 2016 +0200
@@ -247,6 +247,9 @@
             return new Response(false, 697, null);
         }
         Response response = defaultRepo.update(zusatzwert, "land");
+        if (!response.getSuccess()) {
+            return response;
+        }
         Response updated = defaultRepo.getById(
             LZusatzWert.class,
             ((LZusatzWert)response.getData()).getId(), "land");
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)