# HG changeset patch # User Torsten Irländer # Date 1366297386 -7200 # Node ID 624611a29348423f2183972f5799ab4e9c0f2ee0 # Parent de959fc71eda77b703b46e806a223fd391b5589c Provide GET method to load a list of proben. diff -r de959fc71eda -r 624611a29348 src/main/java/de/intevation/rest/LProbeRESTService.java --- 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 result = repository.findAll(); + System.out.println(result); return "Probenliste"; } @@ -36,7 +45,7 @@ //@GET //@Produces("text/xml") //public List 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