Specifying Multitable Info

Use the Multitable Info tab to define multiple tables for a descriptor in the TopLink Mapping editor.

To associate multiple tables with a descriptor:

  1. In the Structure window, select a descriptor.
    If the Multitable Info advanced property is not visible for the descriptor, right-click the descriptor and choose Advanced Properties > Multitable Info from the pop-up menu.
  2. Click the Multitable Info Tab tab.

    Figure 4-24 Multitable Info Tab

    This figure shows the Multi-table Info tab.

  3. Complete the information on the Multitable Info Tab tab.

When associating an additional table via Primary Key, additional options appear on the Multitable Info tab. Continue with "Primary Keys Match" or "Primary Keys are Named Differently" to assign the primary key.

Figure 4-25 Associating Multiple Tables via Primary Key

This figure shows the Table Reference area of the
Multi-table Info tab for table references in which
the primary keys have the same names.

When associating a table via Foreign Key, additional options (shown in Figure 4-25) appear. You must choose a reference that relates the correct fields in the primary table to the primary keys in the selected table. Continue with "Tables are Related by Foreign Key in Primary Table" to assign the foreign key.

Figure 4-26 Associating Multiple Tables via Foreign Key

This figure shows the Table Reference area
of the Multi-table Info tab.

Primary Keys Match

When associating a descriptor with multiple tables in which the primary key field names are identical, you do not have to specify any additional information. Select the tables from the list of available tables on the Multitable Info tab. The TopLink Mapping editor automatically selects the Primary Keys Have the Same Names option.

Primary Keys are Named Differently

If the primary keys of the additional table(s) are the same, but they are named differently, you must specify how they relate to the primary key(s) of the default/primary table.

  1. Select the associated table, and select Associated Via Primary Key.
  2. Select Primary Keys Have Different Names.
  3. In the Primary Key Reference area (Figure 4-25), choose a table reference that relates how the primary keys of the primary table relate to the primary keys of the selected table. Use the drop-down list to select a primary key association.

Tables are Related by Foreign Key in Primary Table

If the primary keys of the additional table are not the same as the primary keys of the primary table, but are instead related to a different set of fields, you must set up a foreign key relation between the tables.

  1. Select the associated table, and select Associated Via Foreign Key.
  2. Use the drop-down list to choose a foreign key reference that relates the correct fields in the primary table to the primary keys in the selected table. Click Browse to create a reference.

Related Topics

About TopLink Descriptors

Working with Multiple Tables
Working with Descriptors
Working with Descriptor Properties
Working with Advanced Properties

 

Copyright © 1997, 2004, Oracle. All rights reserved.