[Lada-commits] [PATCH] Fixed probe object delete service

Wald Commits scm-commit at wald.intevation.org
Thu Aug 6 09:56:29 CEST 2015


# HG changeset patch
# User Raimund Renkert <raimund.renkert at intevation.de>
# Date 1438847769 -7200
# Node ID 03e26dbdfd773c341c73e12c0d61353097a6dbd7
# Parent  60cc9b5126d10e5554581c35b80b0e5f113f95e8
Fixed probe object delete service.

diff -r 60cc9b5126d1 -r 03e26dbdfd77 src/main/java/de/intevation/lada/rest/ProbeService.java
--- a/src/main/java/de/intevation/lada/rest/ProbeService.java	Mon Jul 27 12:58:34 2015 +0200
+++ b/src/main/java/de/intevation/lada/rest/ProbeService.java	Thu Aug 06 09:56:09 2015 +0200
@@ -503,17 +503,6 @@
         ) {
             return new Response(false, 699, null);
         }
-        /* Create a query and request the probetranslation object for the
-         * probe*/
-        QueryBuilder<ProbeTranslation> builder =
-            new QueryBuilder<ProbeTranslation>(
-                defaultRepo.entityManager("land"), ProbeTranslation.class);
-        builder.and("probe", probeObj.getId());
-        Response probeTrans = defaultRepo.filter(builder.getQuery(), "land");
-        @SuppressWarnings("unchecked")
-        ProbeTranslation probeTransObj = ((List<ProbeTranslation>)probeTrans.getData()).get(0);
-        /* Delete the probe translation object*/
-        defaultRepo.delete(probeTransObj, "land");
         /* Delete the probe object*/
         try {
             Response response = defaultRepo.delete(probeObj, "land");
@@ -521,7 +510,6 @@
         }
         catch(IllegalArgumentException | EJBTransactionRolledbackException |
             TransactionRequiredException e) {
-            defaultRepo.update(probeTransObj, "land");
             return new Response(false, 600, "");
         }
     }


More information about the Lada-commits mailing list