Oracle® Application Server TopLink Mapping Workbench User's Guide
10g Release 2 (10.1.2) Part No. B15900-01 |
|
Previous |
Next |
In TopLink, two objects are related by aggregation if there is a one-to-one relationship between the objects and all the attributes of the second object can be retrieved from the same table(s) as the owning object. In the advanced tutorial, the EmploymentPeriod
is an aggregate descriptor, and the period
attribute is an aggregate object.
To map an aggregate object:
Select the EmploymentPeriod
descriptor in the Navigator pane.
Description of the illustration agdesbtn.gif
Description of the illustration agdesicn.gif
Click the Aggregate Descriptor button on the mapping toolbar. The descriptor's icon in the Navigator pane changes to an aggregate descriptor.
Map the startDate
and EndDate
attributes of the EmploymentPeriod
as direct-to-field mappings.
Note: The Database Field fields are disabled because the aggregate descriptor is not associated with a database table. |
Expand the Employee descriptor in the Navigator pane.
Select the period
attribute of the Employee
descriptor.
Description of the illustration agmapbtn.gif
Click the Aggregate Mapping button on the mapping toolbar.
Use the Reference Descriptor drop-down list to choose the EmploymentPeriod
aggregate descriptor.
Click the Fields tab.
Use the Fields drop-down list to map each field as follows:
endDate
– END_DATE
startDate
– START_DATE
Description of the illustration savebtn.gif
Click Save on the toolbar or choose File > Save Project to save the project.