changeset 15:624611a29348

Provide GET method to load a list of proben.
author Torsten Irländer <torsten.irlaender@intevation.de>
date Thu, 18 Apr 2013 17:03:06 +0200
parents de959fc71eda
children 823a417cb8e5
files src/main/java/de/intevation/rest/LProbeRESTService.java
diffstat 1 files changed, 13 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/main/java/de/intevation/rest/LProbeRESTService.java	Thu Apr 18 17:02:21 2013 +0200
+++ b/src/main/java/de/intevation/rest/LProbeRESTService.java	Thu Apr 18 17:03:06 2013 +0200
@@ -1,12 +1,16 @@
 package de.intevation.rest;
 
+import java.util.List;
+
 import javax.enterprise.context.RequestScoped;
 import javax.inject.Inject;
-import javax.persistence.EntityManager;
 import javax.ws.rs.GET;
 import javax.ws.rs.Path;
 import javax.ws.rs.Produces;
 
+import de.intevation.data.LProbeRepository;
+import de.intevation.model.LProbe;
+
 /**
  * JAX-RS Example
  *
@@ -17,12 +21,17 @@
 @RequestScoped
 public class LProbeRESTService {
 
-   //@Inject
-   //private EntityManager em;
+   @Inject
+   private LProbeRepository repository;
+
+   @Inject
+   private Logger log;
 
    @GET
    @Produces("text/plain")
    public String listAllMembers() {
+      final List<LProbe> result = repository.findAll();
+      System.out.println(result);
       return "Probenliste";
    }
 
@@ -36,7 +45,7 @@
    //@GET
    //@Produces("text/xml")
    //public List<Member> listAllMembers() {
-   //   // Use @SupressWarnings to force IDE to ignore warnings about "genericizing" the results of
+   //   // Us @SupressWarnings to force IDE to ignore warnings about "genericizing" the results of
    //   // this query
    //   @SuppressWarnings("unchecked")
    //   // We recommend centralizing inline queries such as this one into @NamedQuery annotations on
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)