changeset 44:2d89a04d5ad9

LProbe repository now extends the generic repository.
author Raimund Renkert <rrenkert@intevation.de>
date Fri, 24 May 2013 11:51:51 +0200
parents 13178bbe77ff
children a5ee8d69c0b4
files src/main/java/de/intevation/lada/data/LProbeRepository.java
diffstat 1 files changed, 4 insertions(+), 29 deletions(-) [+]
line wrap: on
line diff
--- a/src/main/java/de/intevation/lada/data/LProbeRepository.java	Fri May 24 11:51:01 2013 +0200
+++ b/src/main/java/de/intevation/lada/data/LProbeRepository.java	Fri May 24 11:51:51 2013 +0200
@@ -6,15 +6,13 @@
 import javax.enterprise.context.ApplicationScoped;
 import javax.inject.Inject;
 import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-import javax.persistence.PersistenceContextType;
 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.LProbeManager;
 import de.intevation.lada.model.LProbe;
-import de.intevation.lada.service.LProbeService;
 
 /**
  * This Container is an interface to request, filter and select LProbe
@@ -23,7 +21,7 @@
  * @author <a href="mailto:rrenkert@intevation.de">Raimund Renkert</a>
  */
 @ApplicationScoped
-public class LProbeRepository {
+public class LProbeRepository extends Repository{
 
     /**
      * The entitymanager managing the data.
@@ -32,20 +30,10 @@
     private EntityManager em;
 
     /**
-     * Service class for LPRobe. Used to manipulate data objects.
+     * Manager class for LPRobe. Used to manipulate data objects.
      */
     @Inject
-    private LProbeService service;
-
-    /**
-     * Find a single LProbe object identified by its id.
-     *
-     * @param id The mst_id
-     * @return The SMessStelle object.
-     */
-    public LProbe findById(String id) {
-        return em.find(LProbe.class, id);
-    }
+    private LProbeManager manager;
 
     /**
      * Filter for LProbe objects.
@@ -89,17 +77,4 @@
         }
         return em.createQuery(criteria).getResultList();
     }
-
-    /**
-     * Get all LProbe objects from database.
-     *
-     * @return List of LProbe objects.
-     */
-    public List<LProbe> findAll() {
-        CriteriaBuilder cb = em.getCriteriaBuilder();
-        CriteriaQuery<LProbe> criteria = cb.createQuery(LProbe.class);
-        Root<LProbe> member = criteria.from(LProbe.class);
-        criteria.select(member);
-        return em.createQuery(criteria).getResultList();
-    }
 }
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)