I am using FullEntityRepository
of deltaspike
, Response
has to be a status 204
if it works, and status 400
if it does not. Any tips?
Layer service:
@Transactional
public void deletar(Integer id){
MotivoConcessao motivoConcessaoParaDeletar = repositorio.findBy(id);
repositorio.remove(motivoConcessaoParaDeletar);
}
Camada resource:
@DELETE
@Path("{id}")
public Response deletar(@PathParam("id") @Min(value = 1, message = "{recursomotivoconcessao.id.min}") Integer id) {
return Response.status(204).entity(servico.deletar(id)).build();
}