}
public void testMerge(Boolean useSameEm)
{
EntityManager em = emf.createEntityManager();
StudentBooleanWrapper student = em.find(StudentBooleanWrapper.class, getMaxValue(Boolean.class));
Assert.assertNotNull(student);
Assert.assertEquals(getMaxValue(short.class), student.getAge());
Assert.assertEquals(getMaxValue(String.class), student.getName());
student.setName("Kuldeep");
em.merge(student);
if (!useSameEm)
{
em.close();
em = emf.createEntityManager();
}
StudentBooleanWrapper newStudent = em.find(StudentBooleanWrapper.class, getMaxValue(Boolean.class));
Assert.assertNotNull(newStudent);
Assert.assertEquals(getMaxValue(short.class), newStudent.getAge());
Assert.assertEquals("Kuldeep", newStudent.getName());
}