public Person1 createPerson1(EntityManager em, int id) { Person1 p = new Person1(); PersonId1 pid = new PersonId1(); pid.setFirstName("f_" + id); pid.setLastName("l_" + id); p.setId(pid); MedicalHistory1 m = createMedicalHistory1(em, mId1++); m.setPatient(p); p.setMedical(m); em.persist(m); em.persist(p); persons1.put(pid.getFirstName(), p); medicals1.put(m.getPatient().getId().getFirstName(), m); return p; }
public MedicalHistory1 createMedicalHistory1(EntityManager em, int id) { MedicalHistory1 m = new MedicalHistory1(); m.setName("medical_" + id); return m; }