* Hence the company's address->country should be loaded but not the
* employee's.
*/
public void testRelationTraversalWithCompanyAsRoot() {
OpenJPAEntityManager pm = getPM();
FetchPlan plan = pm.getFetchPlan();
plan.setMaxFetchDepth(2);
plan.addFetchGroup("company.departments");
plan.addFetchGroup("company.address");
plan.addFetchGroup("department.employees");
plan.addFetchGroup("person.address");
plan.addFetchGroup("address.country");
PCCompany company =
(PCCompany) pm.find(PCCompany.class, _rootCompanyId);
Set departments = (Set) PCCompany.reflect(company, "departments");
assertNotNull("department is null", departments);