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 a Direct Collection Mapping

Direct collection mappings store collections of Java objects that are not TopLink-enabled. In the advanced tutorial, the responsibilitiesList attribute is a direct collection.

To map a direct collection:

  1. Expand the Employee descriptor in the Navigator pane.

  2. Click the responsibilitiesList attribute of the Employee descriptor.

  3. Direct collection button.
    Description of the illustration dcmapbtn.gif

    Click the Direct Collect button on the mapping toolbar.

  4. To specify where to place the strings in the direct collection, use the Target Table and Direct Field drop-down lists to select the DESCRIP field on the RESPONS databases table.

  5. Select the Use Indirection option and choose ValueHolder. See "Implementing Indirection in the Tutorial".

    Figure B-40 Direct Collection Mapping General Tab

    Description of dctab.gif follows
    Description of the illustration dctab.gif

  6. Click the Table Reference tab, and add a new table reference by clicking the New button.

    • Create a reference named RESPONS_EMPLOYEE, with a source table of RESPONS and target table of EMPLOYEE and click OK.

    • In the Table Reference drop-down list, choose the RESPONS_EMPLOYEE.

    • Click the Add button on the Table Reference tab to add a foreign key relationship.

    • Set the Source Field (foreign key) to EMP_ID (from the RESPONS table).

    • Set the Target Field (primary key) to EMP_ID (from the EMPLOYEE table).

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

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