comparison src/main/java/de/intevation/rest/LProbeRESTService.java @ 23:00ed8e5b05b6

Added functions to Rest-Service to add and delete a item
author Torsten Irländer <torsten.irlaender@intevation.de>
date Fri, 26 Apr 2013 15:02:05 +0200
parents 7a9e22e7e8af
children dc3bfcc5f717
comparison
equal deleted inserted replaced
22:c19770952a6e 23:00ed8e5b05b6
39 @Path("/{id:[0-9][0-9]*}") 39 @Path("/{id:[0-9][0-9]*}")
40 @Produces("text/plain") 40 @Produces("text/plain")
41 public String loadById() { 41 public String loadById() {
42 return "Eine Probe!"; 42 return "Eine Probe!";
43 } 43 }
44
45 @GET
46 @Path("/deleteLast")
47 @Produces("text/plain")
48 public String deleteLast() {
49 final List<LProbe> result = repository.findAll();
50 LProbe last_element = result.get(result.size()-1);
51 repository.delete(last_element);
52 return "Gelöscht id" + last_element.getProbeId();
53 }
44 54
55 @GET
56 @Path("/new")
57 @Produces("text/plain")
58 public String create() {
59 return "Neu";
60 }
45 //@GET 61 //@GET
46 //@Produces("text/xml") 62 //@Produces("text/xml")
47 //public List<Member> listAllMembers() { 63 //public List<Member> listAllMembers() {
48 // // Us @SupressWarnings to force IDE to ignore warnings about "genericizing" the results of 64 // // Us @SupressWarnings to force IDE to ignore warnings about "genericizing" the results of
49 // // this query 65 // // this query
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)