changeset 747:214508fd95e7

Set the new created status protocol at messung.
author Raimund Renkert <raimund.renkert@intevation.de>
date Tue, 27 Oct 2015 10:29:30 +0100
parents 9f3029b5fc90
children 75e87b7d37c0 37a8f4d157c7
files src/main/java/de/intevation/lada/rest/StatusService.java
diffstat 1 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/main/java/de/intevation/lada/rest/StatusService.java	Tue Oct 27 09:59:21 2015 +0100
+++ b/src/main/java/de/intevation/lada/rest/StatusService.java	Tue Oct 27 10:29:30 2015 +0100
@@ -26,6 +26,7 @@
 import de.intevation.lada.lock.LockConfig;
 import de.intevation.lada.lock.LockType;
 import de.intevation.lada.lock.ObjectLocker;
+import de.intevation.lada.model.land.LMessung;
 import de.intevation.lada.model.land.LStatusProtokoll;
 import de.intevation.lada.util.annotation.AuthorizationConfig;
 import de.intevation.lada.util.annotation.RepositoryConfig;
@@ -191,10 +192,17 @@
         ) {
             return new Response(false, 699, null);
         }
+        Response response = defaultRepo.create(status, "land");
+        LStatusProtokoll created = (LStatusProtokoll)response.getData();
+        Response messungResponse = defaultRepo.getById(
+            LMessung.class, status.getMessungsId(), "land");
+        LMessung messung = (LMessung)messungResponse.getData();
+        messung.setStatus(created.getId());
+        defaultRepo.update(messung, "land");
         /* Persist the new object*/
         return authorization.filter(
             request,
-            defaultRepo.create(status, "land"),
+            response,
             LStatusProtokoll.class);
     }
 
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)