@PayloadRoot(namespace = NAMESPACE_URI, localPart = "deleteReservaRequest") @ResponsePayload public DeleteReservaResponse deleteReserva(@RequestPayload DeleteReservaRequest request) { DeleteReservaResponse response = new DeleteReservaResponse(); reservaService.delete(request.getId()); return response; }
@PayloadRoot(namespace = NAMESPACE_URI, localPart = "getReservaRequest") @ResponsePayload public GetReservaResponse getReserva(@RequestPayload GetReservaRequest request) { GetReservaResponse response = new GetReservaResponse(); response.setReserva(reservaService.findById(request.getId())); return response; }
@PayloadRoot(namespace = NAMESPACE_URI, localPart = "saveReservaRequest") @ResponsePayload public SaveReservaResponse saveReserva(@RequestPayload SaveReservaRequest request) throws BusinessException { SaveReservaResponse response = new SaveReservaResponse(); Reserva entity = reservaService.save(request.getReserva()); response.setReserva(entity); return response; }
@PayloadRoot(namespace = NAMESPACE_URI, localPart = "listAllReservaRequest") @ResponsePayload public ListAllReservaResponse listAllReserva(@RequestPayload ListAllReservaRequest request) { ListAllReservaResponse response = new ListAllReservaResponse(); List<Reserva> reservaList = new ArrayList<Reserva>(); Iterable<Reserva> reservaIt = reservaService.findAll(); for (Reserva reserva : reservaIt) { reservaList.add(reserva); } response.getAllReservas().addAll(reservaList); return response; }