public void testCascadeMerge() {
EntityManager em = emf.createEntityManager();
try {
em.getTransaction().begin();
EntityF enF = new EntityF();
enF.setId(1);
em.persist(enF);
em.getTransaction().commit();
em.close();
em = emf.createEntityManager();
em.getTransaction().begin();
EntityF enF1 = em.find(EntityF.class, 1);
enG1.setEntityF(enF1);
enG2.setEntityF(enF1);
List<EntityG> l = new ArrayList<EntityG>();
l.add(enG1);
l.add(enG2);
enF1.setListG(l);
em.merge(enG1);
em.getTransaction().commit();
}
finally {
if (em.getTransaction().isActive())