# HG changeset patch
# User Raimund Renkert <rrenkert@intevation.de>
# Date 1372938191 -7200
# Node ID 90404d19e75dcab0f039d48e025aac69ed9f6264
# Parent  f4824d67afb00134c1139a28a657d9d3dc8d90f5
Implemented delete for LKommentarM and LOrt repositories.

diff -r f4824d67afb0 -r 90404d19e75d src/main/java/de/intevation/lada/data/LKommentarMRepository.java
--- a/src/main/java/de/intevation/lada/data/LKommentarMRepository.java	Thu Jul 04 13:38:48 2013 +0200
+++ b/src/main/java/de/intevation/lada/data/LKommentarMRepository.java	Thu Jul 04 13:43:11 2013 +0200
@@ -147,7 +147,22 @@
 
     @Override
     public Response delete(Object object) {
-        // TODO Auto-generated method stub
-        return null;
+        if (!(object instanceof LKommentarM)) {
+            return new Response(false, 602, null);
+        }
+        LKommentarM kommentar = (LKommentarM)object;
+        Response response = new Response(true, 200, null);
+        try {
+            manager.delete(kommentar);
+        }
+        catch (IllegalArgumentException iae) {
+            response.setSuccess(false);
+            response.setMessage(602);
+        }
+        catch (TransactionRequiredException tre) {
+            response.setSuccess(false);
+            response.setMessage(603);
+        }
+        return response;
     }
 }
diff -r f4824d67afb0 -r 90404d19e75d src/main/java/de/intevation/lada/data/LOrtRepository.java
--- a/src/main/java/de/intevation/lada/data/LOrtRepository.java	Thu Jul 04 13:38:48 2013 +0200
+++ b/src/main/java/de/intevation/lada/data/LOrtRepository.java	Thu Jul 04 13:43:11 2013 +0200
@@ -168,7 +168,22 @@
 
     @Override
     public Response delete(Object object) {
-        // TODO Auto-generated method stub
-        return null;
+        if (!(object instanceof LOrt)) {
+            return new Response(false, 602, null);
+        }
+        LOrt ort = (LOrt)object;
+        Response response = new Response(true, 200, null);
+        try {
+            manager.delete(ort);
+        }
+        catch (IllegalArgumentException iae) {
+            response.setSuccess(false);
+            response.setMessage(602);
+        }
+        catch (TransactionRequiredException tre) {
+            response.setSuccess(false);
+            response.setMessage(603);
+        }
+        return response;
     }
 }