detail.setPhoneNo(12456);
detail.setEmailId("xyz@gmail.com");
detail.setAddress("BBBBB");
detail.setPhone(phone);
PersonnelEmbedded personnel = new PersonnelEmbedded();
personnel.setId(1);
personnel.setAge(24);
personnel.setName("Kuldeep");
personnel.setPersonalDetail(detail);
em.persist(personnel);
em.clear();
PersonnelEmbedded foundPersonnel = em.find(PersonnelEmbedded.class, 1);
Assert.assertNotNull(foundPersonnel);
Assert.assertNotNull(foundPersonnel.getPersonalDetail());
Assert.assertNotNull(foundPersonnel.getPersonalDetail().getPhone());
Assert.assertEquals("xamry", foundPersonnel.getPersonalDetail().getPhone().getContactName().get(0));
Set<String> hashSet = new HashSet<String>();
hashSet.add("9891991919");
Assert.assertEquals(hashSet, foundPersonnel.getPersonalDetail().getPhone().getContactNumber());
List<PersonnelEmbedded> personnels = em.createQuery("Select p from PersonnelEmbedded p").getResultList();
Assert.assertNotNull(personnels);
Assert.assertFalse(personnels.isEmpty());
Assert.assertNotNull(personnels.get(0));