Chapter 4 Building Physical Diagrams


Reference property sheet Joins tab

A join is a link between a column in a parent table and a column in a child table (column pair) that is defined within a reference.

A join can link primary, alternate or foreign key, or user-specified columns in the parent and child tables that are independent of key columns.

Steps To define joins in a reference:

  1. Double-click a reference in the diagram to open its property sheet, and then click the Joins tab.
  2. Select a key in the Parent Key list to create joins on its columns. If you select <NONE>, the column lists are empty and you must specify your own columns to join.

    The columns linked by the joins are listed in the Parent Table and Child Table columns.


    Note   Changing a foreign key column linked by a join
    You can change the foreign key column linked by a join by clicking the column in the Child Table list, and selecting another column from the list.



  3. [optional] If you selected <NONE> from the Parent Key list, click the Parent Table Column and select a column from the list, then click the Child Table Column and select a child column.
  4. [optional] Select the Auto arrange join order check box to sort the list by the key column order. If this option is not selected, you can re-arrange the columns using the arrow buttons.
  5. Click OK.

Note   Enabling the Auto arrange join order check box
To enable this check box, add an EnableChangeJoinOrder item to the Reference category in the DBMS definition file and set the value to YES. See the DBMS Resource File Reference chapter of the Customizing and Extending PowerDesigner manual.

Default joins at reference creation

Join creation is determined by the following Model Options:

Default Link on Creation Auto-migrate Columns
Result
Primary Key Selected Joins created between primary and foreign key columns.
  Not selected Joins created and linked to primary key columns, but are incomplete. Foreign key columns must be specified manually.
User-defined Selected No joins created. Parent and child table column pairs must be specified manually.
  Not selected No joins created. Parent and child table column pairs must be specified manually.

Linking columns in a primary or alternate key

For any reference you can choose to link a primary key, or alternate key, to a corresponding foreign key. When you select a key from the Joins tab of the reference property sheet, all the key columns are linked to matching foreign key columns in the child table.

Note   Changing a foreign key column link
A foreign key column can be changed to link to another parent table column, either within the key relationship, or independent of it.

Reuse and Migration option for a selected reference

You can use the following buttons on the Joins tab to reuse or migrate columns linked by joins.

Tool Description

Reuse Columns - Reuse existing child columns with same code as parent table columns

Migrate Columns - Migrate key columns to foreign key columns. If columns do not exist they are created

Cancel Migration - Delete any migrated columns in child table

 


Copyright (C) 2008. Sybase Inc. All rights reserved.