public int CarregaNumCod() {
Agenda agenda ;
Integer serial,id = 0;
Integer dserEst = 0;
String dserPar = "AGD";
serial = dserRepo.findById(dserEst, dserPar);
while (id == 0) {
serial ++;
try {
agenda = manager.find(Agenda.class, serial);
agenda.getAgdcod();
} catch (Exception e) {
id = 1 ;
}
}
return serial;
}
dserRepo.findById(dserEst, dserPar);
while (id == 0) {
serial ++;
try {
agenda = manager.find(Agenda.class, serial);
agenda.getAgdcod();
} catch (Exception e) {
id = 1 ;
}
}
Obrigado !!