}
public void testDeleteReferencedObject(boolean withEvict) {
PersistenceManager pm = pmf.getPersistenceManager();
pm.currentTransaction().begin();
Employee e = new Employee("employee testDeleteReferencedObject",
new Department("department testDeleteReferencedObject"));
pm.makePersistent(e);
long eid = e.getOid();
Long did = e.getDept().getOid();
e= null;
pm.currentTransaction().commit();
pm.currentTransaction().begin();
Department d = (Department) pm.getObjectById(
pm.newObjectIdInstance(Department.class, "" + did), true);
pm.deletePersistent(d);
d = null;
pm.currentTransaction().commit();
if (withEvict) {
pm.evictAll();
}
pm.currentTransaction().begin();
e = (Employee) pm.getObjectById(
pm.newObjectIdInstance(Employee.class, "" + eid), true);
boolean isNull = (null == e.getDept());
pm.currentTransaction().commit();
pm.currentTransaction().begin();
pm.deletePersistent(e);
pm.currentTransaction().commit();