示例#1
0
  @Test
  public void manyToManyTest() {
    persistSimplePOJO();

    Patient patient = em.find(Patient.class, 1l);
    assertEquals(2, patient.getPatientsPills().size());
  }
示例#2
0
  @Test
  public void loadTest() {
    persistSimplePOJO();

    Patient patient = em.find(Patient.class, 1l);
    assertEquals("Mark", patient.getName());
  }
示例#3
0
  public Patient getPatient() {
    Patient patient = new Patient();
    patient.setDateOfBirth(new Date());
    patient.setGender(Gender.MALE);
    patient.setName("Mark");
    patient.setFamilyName("Tompson");

    List<Pills> pills = new ArrayList<Pills>();
    pills.add(new Pills("Vicodin"));
    pills.add(new Pills("Aspirin"));

    patient.setPatientsPills(pills);
    return patient;
  }