@GET @Path("/get") @Consumes(MediaType.APPLICATION_XML) public Temperature read(@QueryParam("id") long id) { System.out.println("readTemperature"); return temperatureEJB.findTemperatureById(id).toTemperatureData(); }
@DELETE @Path("/del") public void delete(@QueryParam("id") long id) { System.out.println("deleteTemperature"); TemperatureEntity temperature = temperatureEJB.findTemperatureById(id); if (temperature != null) { temperatureEJB.deleteTemperature(temperature); } }