changeset 393:ab0307eccee8

Save a new ort object and set the field 'bezeichnung' with a generated value.
author Raimund Renkert <raimund.renkert@intevation.de>
date Thu, 05 Dec 2013 09:55:13 +0100
parents 9d5e4d4eb90f
children b58050341040
files src/main/java/de/intevation/lada/data/OrtRepository.java
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/main/java/de/intevation/lada/data/OrtRepository.java	Thu Dec 05 09:54:19 2013 +0100
+++ b/src/main/java/de/intevation/lada/data/OrtRepository.java	Thu Dec 05 09:55:13 2013 +0100
@@ -97,7 +97,10 @@
         }
         Ort ort = (Ort)object;
         try {
-            manager.create(ort);
+            manager.persist(ort);
+            int id = ort.getOrtId();
+            ort.setBezeichnung("D_ " + String.format("%05d", id));
+            manager.update(ort);
             return new Response(true, 200, ort);
         }
         catch(EntityExistsException eee) {
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)