changeset 255:a3ef7a5f2be8

Implemented 'delete' for LMessung.
author Raimund Renkert <rrenkert@intevation.de>
date Mon, 15 Jul 2013 17:49:46 +0200
parents dc41bddf67c0
children 18f87f4ff767
files src/main/java/de/intevation/lada/data/LMessungRepository.java
diffstat 1 files changed, 20 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/main/java/de/intevation/lada/data/LMessungRepository.java	Mon Jul 15 17:05:26 2013 +0200
+++ b/src/main/java/de/intevation/lada/data/LMessungRepository.java	Mon Jul 15 17:49:46 2013 +0200
@@ -183,11 +183,28 @@
     }
 
     /**
-     * This class does not support this operation.
+     * Delete a LMessung object.
      *
-     * @param object
+     * @param object    The object to delete.
+     * @return Response object.
      */
     public Response delete(Object object) {
-        return null;
+        if (!(object instanceof LMessung)) {
+            return new Response(false, 602, null);
+        }
+        LMessung messung = (LMessung)object;
+        Response response = new Response(true, 200, null);
+        try {
+            manager.delete(messung);
+        }
+        catch (IllegalArgumentException iae) {
+            response.setSuccess(false);
+            response.setMessage(602);
+        }
+        catch (TransactionRequiredException tre) {
+            response.setSuccess(false);
+            response.setMessage(603);
+        }
+        return response;
     }
 }
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)