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
 

Using Multiple Tables

In TopLink, it is possible to spread classes across two or more tables. In the advanced tutorial, the Employee class is stored in multiple tables: although most information is in the EMPLOYEE table, salary information is stored in the SALARY table.

To map the Employee class to multiple tables:

  1. Select the Employee descriptor in the Navigator pane.

  2. Click the Multi-Table Info tab in the Editor pane.

    If the Multi-Table info tab is not visible, right-click the Employee descriptor and choose Set Advanced Properties >  Multi-Table Info from the pop-up menu.

  3. In the Additional Tables pane, click Add and add the SALARY table.

  4. In the Associated Via pane select Primary Key and in the Primary Key Table Reference pane, select Primary Keys Have Same Names.

    Figure B-36 Multi-Table Info Tab

    Description of multitab.gif follows
    Description of the illustration multitab.gif

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

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