Пример #1
0
 public boolean equals(Object o) {
   if (o == null) return false;
   if (!(o instanceof Person4)) return false;
   Person4 p0 = (Person4) o;
   PersonId4 id0 = p0.getId();
   if (!id.equals(id0)) return false;
   MedicalHistory4 medical0 = p0.getMedical();
   if (medical != null && !medical.patient.getId().equals(medical0.patient.getId())) return false;
   if (medical == null && medical0 != null) return false;
   return true;
 }
Пример #2
0
  public void findObj7() {
    EntityManager em = emf.createEntityManager();
    Person4 p = em.find(Person4.class, new PersonId4("f_1", "l_1"));
    Person4 p0 = persons4.get("f_1");
    Person4 p1 = p.getMedical().getPatient();
    assertEquals(p1, p);
    em.clear();

    MedicalHistory4 m = em.find(MedicalHistory4.class, new PersonId4("f_1", "l_1"));
    MedicalHistory4 m0 = medicals4.get("f_1");
    assertEquals(m, m0);
    em.close();
  }