public boolean updateInfos(Boleto b, Contador p) { Boleto boleto = boletoRepository.findById(b.getId()); if (boleto.getContador() == p) { boleto.setEmpresa(b.getEmpresa()); boleto.setListaNotas(b.getListaNotas()); boleto.setValor(b.getValor()); boletoRepository.saveAndFlush(boleto); return true; } return false; }