@PUT @Path("/{id:[0-9][0-9]*}") @Consumes(MediaType.APPLICATION_JSON) public Response update(@PathParam("id") Long id, Vendor entity) { entity.setId(id); entity = em.merge(entity); return Response.noContent().build(); }
@POST @Consumes(MediaType.APPLICATION_JSON) public Response create(Vendor entity) { em.persist(entity); return Response.created( UriBuilder.fromResource(VendorEndpoint.class) .path(String.valueOf(entity.getId())) .build()) .build(); }