Skip Headers
Oracle® Application Server TopLink Mapping Workbench User's Guide
10g Release 2 (10.1.2)
Part No. B15900-01
  Go To Documentation Library
Home
Go To Product List
Solution Area
Go To Table Of Contents
Contents
Go To Index
Index

Previous
Previous
Next
Next
 

Implementing an Aggregate Object

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:

  1. Select the EmploymentPeriod descriptor in the Navigator pane.

  2. Aggregate descriptor button.
    Description of the illustration agdesbtn.gif

    Aggregate icon.
    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.

  3. 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.

  4. Expand the Employee descriptor in the Navigator pane.

  5. Select the period attribute of the Employee descriptor.

  6. Aggregate mapping button.
    Description of the illustration agmapbtn.gif

    Click the Aggregate Mapping button on the mapping toolbar.

    Figure B-38 Aggregate Mapping General Tab

    Description of aggobj.gif follows
    Description of the illustration aggobj.gif

  7. Use the Reference Descriptor drop-down list to choose the EmploymentPeriod aggregate descriptor.

  8. Click the Fields tab.

    Figure B-39 Aggregate Mapping Fields Tab

    Description of agmapfld.gif follows
    Description of the illustration agmapfld.gif

  9. Use the Fields drop-down list to map each field as follows:

    • endDate – END_DATE

    • startDate – START_DATE

  10. Save button.
    Description of the illustration savebtn.gif

    Click Save on the toolbar or choose File >  Save Project to save the project.