}
public void testMerge(boolean useSameEm)
{
EntityManager em = emf.createEntityManager();
StudentMongoBooleanPrimitive student = em.find(StudentMongoBooleanPrimitive.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();
}
StudentMongoBooleanPrimitive newStudent = em.find(StudentMongoBooleanPrimitive.class, getMaxValue(boolean.class));
Assert.assertNotNull(newStudent);
Assert.assertEquals(getMaxValue(short.class), newStudent.getAge());
Assert.assertEquals("Kuldeep", newStudent.getName());
}