Reference Properties

To view or edit a reference's properties, double-click its diagram symbol or Browser or list entry. The property sheet tabs and fields listed here are those available by default, before any customization of the interface by you or an administrator.

The General tab contains the following properties:

Property

Description

Name/Code/Comment

Identify the object. The name should clearly convey the object's purpose to non-technical users, while the code, which is used for generating code or scripts, may be abbreviated, and should not normally include spaces. You can optionally add a comment to provide more detailed information about the object. By default the code is generated from the name by applying the naming conventions specified in the model options. To decouple name-code synchronization, click to release the = button to the right of the Code field.

Stereotype

Extends the semantics of the object. You can enter a stereotype directly in this field, or add stereotypes to the list by specifying them in an extension file.

Parent table

Specifies the parent table of the reference. This table contains the primary key, or alternate key, linked by the reference. Use the tools to the right of the list to create, browse for, or view the properties of the currently selected table.

Parent role

Specifies the role of the parent table in the reference. The text is displayed in the diagram, near the parent table.

Child table

Specifies the child table of the reference. This table contains the foreign key linked by the reference.

Child role

Specifies the role of the child table in the reference. The text is displayed in the diagram, near the child table.

Generate

Specifies to generate the reference in the database.

Keywords

Provide a way of loosely grouping objects through tagging. To enter multiple keywords, separate them with commas.

Joins Tab

The Joins tab lists the joins defined between parent and child table columns. Joins can link primary, alternate, or foreign key, or any user-specified columns in the parent and child tables independently from key columns.

Note: You can control the default joins created using the Default link on creation and Auto-migrate columns model options (see Reference Model Options).
On this tab, you can do one of the following:
  • Select a key from the parent table on which to base the join, which will autopopulate the list with parent and child columns associated with the chosen key (though you can modify the specified child column if necessary).
  • Specify <None> in the Parent key field and specify you own column pairs on which to base the join using the following tools:

    Tool

    Description



    Reuse Columns - Create a join by matching parent and child columns that share the same code and data type.



    Migrate Columns - First specify columns in the Parent Table Column column and then click this tool to migrate them to foreign key columns in the child table. If the columns do not exist in the child table, they are created.



    Cancel Migration - Remove any columns migrated to the child table.



    Insert a Row - Inserts a row before the selected row in the list.


    Add a Row - Adds a row at the end of the list.
Note:

Select the Auto arrange join order check box to sort the list by the key column order or deselect it to re-arrange the columns using the arrow buttons. If this option is not available, to enable it, add the EnableChangeJoinOrder item to the Reference category in the DBMS definition file and set the value to YES (see Customizing and Extending PowerDesigner > DBMS Definition Files).

Integrity Tab

Referential integrity governs data consistency between primary keys, alternate keys and foreign keys by dictating what happens when you update or delete a value or delete a row in the parent table. The Integrity tab contains the following properties:

Property

Description

Constraint name

Specifies the name of the referential integrity constraint. Maximum length is 254 characters. If you edit this name, the User-defined button will be depressed. To return to the default name, click to release this button.

Implementation

Specifies how referential integrity will be implemented. You can choose between:
  • Declarative- Referential integrity constraints are defined for particular references. When the reference is generated the target DBMS evaluates the reference validity and generates appropriate error messages.

  • Trigger - Referential integrity constraints are implemented by triggers based on the integrity constraints defined in the reference property sheet. The trigger evaluates reference validity and generates appropriate user-defined error messages.

Cardinality

Indicates the minimum and maximum number of instances in a child table permitted for each corresponding instance in the parent table. The following values are available by default:
  • 0..* - A parent can have zero or more children.

  • 0..1 - A parent can have zero or one children.

  • 1..* - A parent can have one or more children.

  • 1..1 – A parent must have exactly one child

Alternately, you can enter your own integer values in one of the following formats (using * or n to represent no limit):
  • x..y - A parent can have between x and y children. For example: 2..n – There must be at least 2 children.

  • x - A parent can have exactly x children. For example: 10 - There must be exactly 10 children.

  • x..y, a..b - A parent can have between x and y or between a and b children. For example: 1..2, 4..n – There must be one, two, four or more children.

Update/Delete constraint

Specifies how updating a key value in the parent table will affect the foreign key value in the child table. Depending on the implementation and DBMS, you can choose between:
  • None - No effect on the child table.

  • Restrict - Values in the parent table cannot be updated or deleted if one or more matching child values exists.

  • Cascade - Updates or deletions of parent table values are cascaded to matching values in the child table.

  • Set null - Updates or deletions of parent table values set matching values in the child table to NULL.

  • Set default - Updates or deletions of parent table values set matching values in the child table to the default value.

Mandatory parent

Specifies that each foreign key value in the child table must have a corresponding key value, in the parent table.

Change parent allowed

Specifies that a foreign key value can change to select another value in the referenced key in the parent table.

Check on commit

[SQL Anywhere® only] Verifies referential integrity only on commit, instead of after row insertion. You can use this feature to control circular dependencies.

Cluster

Specifies that the reference constraint is a clustered constraint (for those DBMSs that support clustered indexes).