-1
Talk personal, all right? In my context, I need to do an undo method, this out using an array object that saves in memory my last given database persintência and, when saved this data in the array and call the save method (of JPA’s Springboot), with the new data changed in the database, this save method changes the persistence within the array.
public ResponseEntity putLoja(@Valid @RequestBody Loja atualizaLoja, @PathVariable int idLoja) {
if (lojaRepository.existsById(idLoja)) {
atualizaLoja.setId(idLoja);
lojaRepository.save(atualizaLoja);
pilhaLojaAuxiliar.push(lojaRepository.findById(idLoja).get());
return ResponseEntity.status(200).build();
} else {
return ResponseEntity.status(400).build();
}
}