changeset 256:18f87f4ff767

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