changeset 171:8bf3054109ba

Use the generic data manager in repositories.
author Raimund Renkert <rrenkert@intevation.de>
date Mon, 24 Jun 2013 14:12:06 +0200
parents 18b234ef3733
children 8d88224f8ffc
files src/main/java/de/intevation/lada/data/LKommentarMRepository.java src/main/java/de/intevation/lada/data/LKommentarPRepository.java src/main/java/de/intevation/lada/data/LMessungRepository.java src/main/java/de/intevation/lada/data/LMesswertRepository.java src/main/java/de/intevation/lada/data/LOrtRepository.java src/main/java/de/intevation/lada/data/LProbeRepository.java src/main/java/de/intevation/lada/data/LStatusRepository.java src/main/java/de/intevation/lada/data/LZusatzwertRepository.java
diffstat 8 files changed, 24 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/src/main/java/de/intevation/lada/data/LKommentarMRepository.java	Mon Jun 24 14:11:48 2013 +0200
+++ b/src/main/java/de/intevation/lada/data/LKommentarMRepository.java	Mon Jun 24 14:12:06 2013 +0200
@@ -15,7 +15,7 @@
 import javax.persistence.criteria.Predicate;
 import javax.persistence.criteria.Root;
 
-import de.intevation.lada.manage.LKommentarMManager;
+import de.intevation.lada.manage.Manager;
 import de.intevation.lada.model.LKommentarM;
 import de.intevation.lada.rest.Response;
 
@@ -39,7 +39,8 @@
      * Manager class for LPRobe. Used to manipulate data objects.
      */
     @Inject
-    private LKommentarMManager manager;
+    @Named("datamanager")
+    private Manager manager;
 
     @Override
     public Response create(Object object) {
--- a/src/main/java/de/intevation/lada/data/LKommentarPRepository.java	Mon Jun 24 14:11:48 2013 +0200
+++ b/src/main/java/de/intevation/lada/data/LKommentarPRepository.java	Mon Jun 24 14:12:06 2013 +0200
@@ -15,7 +15,7 @@
 import javax.persistence.criteria.CriteriaQuery;
 import javax.persistence.criteria.Root;
 
-import de.intevation.lada.manage.LKommentarPManager;
+import de.intevation.lada.manage.Manager;
 import de.intevation.lada.model.LKommentarP;
 import de.intevation.lada.rest.Response;
 
@@ -31,7 +31,8 @@
     private EntityManager em;
 
     @Inject
-    private LKommentarPManager manager;
+    @Named("datamanager")
+    private Manager manager;
 
     @Inject
     private Logger logger;
--- a/src/main/java/de/intevation/lada/data/LMessungRepository.java	Mon Jun 24 14:11:48 2013 +0200
+++ b/src/main/java/de/intevation/lada/data/LMessungRepository.java	Mon Jun 24 14:12:06 2013 +0200
@@ -14,7 +14,7 @@
 import javax.persistence.criteria.CriteriaQuery;
 import javax.persistence.criteria.Root;
 
-import de.intevation.lada.manage.LMessungManager;
+import de.intevation.lada.manage.Manager;
 import de.intevation.lada.model.LMessung;
 import de.intevation.lada.rest.Response;
 import de.intevation.lada.validation.ValidationException;
@@ -40,7 +40,8 @@
      * Manager class for LPRobe. Used to manipulate data objects.
      */
     @Inject
-    private LMessungManager manager;
+    @Named("datamanager")
+    private Manager manager;
 
     @Inject
     @Named("lmessungvalidator")
--- a/src/main/java/de/intevation/lada/data/LMesswertRepository.java	Mon Jun 24 14:11:48 2013 +0200
+++ b/src/main/java/de/intevation/lada/data/LMesswertRepository.java	Mon Jun 24 14:12:06 2013 +0200
@@ -15,7 +15,7 @@
 import javax.persistence.criteria.Predicate;
 import javax.persistence.criteria.Root;
 
-import de.intevation.lada.manage.LMesswertManager;
+import de.intevation.lada.manage.Manager;
 import de.intevation.lada.model.LMesswert;
 import de.intevation.lada.rest.Response;
 
@@ -39,7 +39,8 @@
      * Manager class for LPRobe. Used to manipulate data objects.
      */
     @Inject
-    private LMesswertManager manager;
+    @Named("datamanager")
+    private Manager manager;
 
     @Override
     public Response create(Object object) {
--- a/src/main/java/de/intevation/lada/data/LOrtRepository.java	Mon Jun 24 14:11:48 2013 +0200
+++ b/src/main/java/de/intevation/lada/data/LOrtRepository.java	Mon Jun 24 14:12:06 2013 +0200
@@ -14,7 +14,7 @@
 import javax.persistence.criteria.CriteriaQuery;
 import javax.persistence.criteria.Root;
 
-import de.intevation.lada.manage.LOrtManager;
+import de.intevation.lada.manage.Manager;
 import de.intevation.lada.model.LOrt;
 import de.intevation.lada.rest.Response;
 import de.intevation.lada.validation.ValidationException;
@@ -35,7 +35,8 @@
     private Validator validator;
 
     @Inject
-    private LOrtManager manager;
+    @Named("datamanager")
+    private Manager manager;
     /**
      * Filter for LOrt objects used for calls from a service.
      *
--- a/src/main/java/de/intevation/lada/data/LProbeRepository.java	Mon Jun 24 14:11:48 2013 +0200
+++ b/src/main/java/de/intevation/lada/data/LProbeRepository.java	Mon Jun 24 14:12:06 2013 +0200
@@ -15,7 +15,7 @@
 import javax.persistence.criteria.Predicate;
 import javax.persistence.criteria.Root;
 
-import de.intevation.lada.manage.LProbeManager;
+import de.intevation.lada.manage.Manager;
 import de.intevation.lada.model.LProbe;
 import de.intevation.lada.model.LProbeInfo;
 import de.intevation.lada.rest.Response;
@@ -41,7 +41,8 @@
      * Manager class for LPRobe. Used to manipulate data objects.
      */
     @Inject
-    private LProbeManager manager;
+    @Named("datamanager")
+    private Manager manager;
 
     @Inject
     @Named("lprobevalidator")
@@ -51,7 +52,6 @@
     public <T> Response findAll(Class<T> clazz) {
         CriteriaBuilder cb = em.getCriteriaBuilder();
         CriteriaQuery<LProbeInfo> criteria = cb.createQuery(LProbeInfo.class);
-        Root<LProbeInfo> member = criteria.from(LProbeInfo.class);
         criteria.distinct(true);
         List<LProbeInfo> result = filter(criteria);
         return new Response(true, 200, result);
--- a/src/main/java/de/intevation/lada/data/LStatusRepository.java	Mon Jun 24 14:11:48 2013 +0200
+++ b/src/main/java/de/intevation/lada/data/LStatusRepository.java	Mon Jun 24 14:12:06 2013 +0200
@@ -15,8 +15,7 @@
 import javax.persistence.criteria.Predicate;
 import javax.persistence.criteria.Root;
 
-import de.intevation.lada.manage.LStatusManager;
-import de.intevation.lada.manage.LZusatzwertManager;
+import de.intevation.lada.manage.Manager;
 import de.intevation.lada.model.LStatus;
 import de.intevation.lada.rest.Response;
 
@@ -40,7 +39,8 @@
      * Manager class for LPRobe. Used to manipulate data objects.
      */
     @Inject
-    private LStatusManager manager;
+    @Named("datamanager")
+    private Manager manager;
 
     @Override
     public Response create(Object object) {
--- a/src/main/java/de/intevation/lada/data/LZusatzwertRepository.java	Mon Jun 24 14:11:48 2013 +0200
+++ b/src/main/java/de/intevation/lada/data/LZusatzwertRepository.java	Mon Jun 24 14:12:06 2013 +0200
@@ -1,6 +1,5 @@
 package de.intevation.lada.data;
 
-import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 
@@ -12,10 +11,9 @@
 import javax.persistence.TransactionRequiredException;
 import javax.persistence.criteria.CriteriaBuilder;
 import javax.persistence.criteria.CriteriaQuery;
-import javax.persistence.criteria.Predicate;
 import javax.persistence.criteria.Root;
 
-import de.intevation.lada.manage.LZusatzwertManager;
+import de.intevation.lada.manage.Manager;
 import de.intevation.lada.model.LZusatzWert;
 import de.intevation.lada.rest.Response;
 
@@ -39,7 +37,8 @@
      * Manager class for LPRobe. Used to manipulate data objects.
      */
     @Inject
-    private LZusatzwertManager manager;
+    @Named("datamanager")
+    private Manager manager;
 
     @Override
     public Response create(Object object) {
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)