The XREL keyword is used to build relationships independent of how the data was retrieved. XREL is valid only in Enterprise JavaBeans™ (EJB) Mediator queries.
xrel := XREL identification_variable . { single_valued_cmr_field | collection_valued_cmr_field } [ , identification_variable . { single_valued_cmr_field | collection_valued_cmr_field } ]*
select e.name from EmpBean e select d.name from DeptBean d xrel d.emps, d.mgrNotice that the employees are retrieved through d.emps relationship, xrel d.mgr is to establish the mgr relationship for those employees who are also a manager.
select d.name from DeptBean d select e.name from in(d.emps) e xrel d.mgr