Skip Headers

# Creating Table References

Previous

Next

References are table properties that contain the foreign key; they may or may not correspond to an actual constraint that exists on the database. TopLink Workbench uses these references when you define relationship mappings and multiple table associations.

When importing tables from the database, TopLink Workbench can automatically create references (if the driver supports this), or you can define references from the workbench. See "Importing Tables From a Database".

To create a new table reference, use this procedure:

1. Select a database table in the Navigator. The table's properties display in the Editor.

2. Click the References tab.

3. In the References area, click Add. The New Reference dialog box appears.

4. Complete each field on the New Reference dialog box and click OK.

Field | Description
--- | ---
Enter Name of New Reference | Specify the name of the reference table. If you leave this field blank, TopLink Workbench automatically creates a name based on the format: SOURCETABLE_TARGETTABLE.
Select the Source Table | Specify the name of the source database table (the currently selected table in the Navigator).
Select the Target Table | Use the list to specify the target table for this reference.
On Database | Specify if you want to create the reference on the database when you create the table. Not all database drivers support this option.

Continue with "Creating Field Associations".

See Also

  Creating Table References
  Creating Field Associations