Dunque, l'entity patient è una normale struttura dati con i suoi campi e i relativi getter e setter (che non posto perchè sarebbe superfluo).
Ti faccio un esempio del problema che mi si presenta. Io creo un'istanza di Patient e ne setto l'Integer idPatient (col valore 13) tramite il setter, poi rendo persistente l'oggetto tramite una save() (come puoi vedere nel codice postato nel precedente messaggio) e subito dopo la save() se vado a leggere il campo idPatient ricavandolo tramite il metodo getter questo risulta essere 1.codice:public abstract class Patient implements java.io.Serializable { // Fields private Integer idPatient; private Date PBirthday; private String PSex; private Integer idPEthnicGroup; private Set patientSdos = new HashSet(0); private Set ruleTestHistories = new HashSet(0); // Constructors /** default constructor */ public Patient() { } /** full constructor */ public Patient(Date PBirthday, String PSex, Integer idPEthnicGroup, Set patientSdos, Set ruleTestHistories) { this.PBirthday = PBirthday; this.PSex = PSex; this.idPEthnicGroup = idPEthnicGroup; this.patientSdos = patientSdos; this.ruleTestHistories = ruleTestHistories; }

Rispondi quotando