EPUB | CHM | PDF

Reference Editor

Top Previous Next

Reference Editor is intended for editing the properties of a foreign key constraint, integrity rules, and choosing referenced columns.

To open the Reference Editor, simply double-click a reference on the diagram or select the Properties item from the reference context menu.

The dialog consists of several tabs, each of which is described in details below.

General

editor-reference-general

This tab allows you to set up the basic reference properties.

Name
You can enter reference name, which will be displayed in the caption in the middle of the reference on the diagram. It is desirable, than name describe relationship role between tables.

Comment
The field to describe the reference role in full.

Parent table
Shows the referenced table's name.

Child table
Shows the referencing table's name.

Generate
Set this option off to exclude the table from the default selection of references in the Database Generation and Database Modification tools.

Joins

This tab allows to choose an active constraint of the referenced table and columns participated in the reference.

editor-reference-joins

In the left side of the grid there is list of columns of referenced table. In the right side there is a list of corresponding foreign key columns of the referencing table.

To change assignment of foreign key column of the referencing table:

Click on the Child table column cell, that corresponds to one of the columns of the referenced table.
The drop-down menu with the list of the referencing table columns will appear.
Then click on the required column of the referencing table.

Integrity

In this tab you can change integrity rules for foreign key constraint.

editor-reference-integrity

When record in referenced table is changed (updated or deleted), it is possible to automatically modify associated records in the referencing table. This is the function of delete/update rules of the constraint.

For example, there are two tables: Orders and Customers. The Orders table has the foreign key column CustID which refer to the Cusomers table. You can delete a record from the Customers table and corresponding records from the Orders table, using one DELETE statement. It is possible because of cascade delete rule.

You can assign a rule both to update and delete event. In the left side there is list of update rules. In the right side there is list of delete rules. Click on the appropriate list item to change a rule.

Update constraint. Sets a rule that will be executed on update of a referenced table's record:

Restrict
Disallow update of the referenced table record if associated records in the child table exist.

Cascade
Update associated records in compliance with referenced table row update.

Set null
Set foreign key columns of associated records to null.

No acton
Do nothing with associated records.

Set default
Set foreign key columns of associated records to default column value. This default value can be set in the Table Columns Manager.

Delete constraint. Sets a rule that will be executed on delete of a referenced table's record:

Restrict
Disallow delete of referenced table record if associated records in the child table are exists.

Cascade
Delete all associated records.

Set null
Set foreign key columns of associated records to NULL.

No acton
Do nothing with associated records.

Set default
Set foreign key columns of associated records to default column value. This default value can be set in the Table Columns Manager.

Note

The Note tab allows you to define a description and an annotation for the edited reference. This properties will not affect the physical database, but they can be useful for your diagram development.

Format

In this tab you can choose the colors which will be used for displaying edited reference on the diagram.

See also:
Diagram Objects: References and Foreign Keys | Creating a Reference | Column Editor | Column Manager
Database Functions: Database Generation | Database Modification