}
public void testCascadesDeleteNonPersistent ()
{
CascadesEntity all = new CascadesEntity ();
CascadesEntity none = new CascadesEntity ();
CascadesEntity manyAll = new CascadesEntity ();
CascadesEntity manyNone = new CascadesEntity ();
OpenJPAEntityManager em = (OpenJPAEntityManager)currentEntityManager();
startTx(em);
em.persist (all);
em.persist (none);
em.persist (manyAll);
em.persist (manyNone);
endTx(em);
long allId = all.getId ();
long noneId = none.getId ();
long manyAllId = manyAll.getId ();
long manyNoneId = manyNone.getId ();
endEm(em);
em = (OpenJPAEntityManager) currentEntityManager();
startTx(em);
CascadesEntity ent = new CascadesEntity ();
ent.setAll (em.find (CascadesEntity.class, allId));
ent.setNone (em.find (CascadesEntity.class, noneId));
ent.getAllCollection ().add (em.find (CascadesEntity.class, manyAllId));
ent.getNoneCollection ().add (em.find (CascadesEntity.class, manyNoneId));
em.remove (ent);
assertTrue (em.isRemoved (ent.getAll ()));
assertFalse (em.isRemoved (ent.getNone ()));
for (CascadesEntity rel : ent.getAllCollection ())
assertTrue (em.isRemoved (rel));
for (CascadesEntity rel : ent.getNoneCollection ())
assertFalse (em.isRemoved (rel));
assertFalse (em.contains (ent));
endTx(em);
endEm(em);