XREL keyword

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 does not retrieve additional data, it only builds relationships from data already retrieved by the select statements. The relationships can be one-to-one, one-to-many, many-to-one, or many-to-many. The relationships can be unidirectional or bidirectional. If you specify a bidirectional relationship in an XREL, the inverse relationship is also established in addition to the specified relationship.
xrel := XREL identification_variable . { single_valued_cmr_field | collection_valued_cmr_field }
	            [ , identification_variable . { single_valued_cmr_field | collection_valued_cmr_field } ]*

Examples: XREL keyword

This example retrieves all employees and all departments, and establishes the emps and mgr relationships.
select e.name from EmpBean e
  select  d.name from DeptBean d
  xrel  d.emps, d.mgr
Notice 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  

指出主題類型的圖示 概念主題



時間戳記圖示 前次更新: July 9, 2016 11:11
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-nd-mp&topic=cque_xrel
檔名:cque_xrel.html