Show/Hide Toolbars

TMS Data Modeler Documentation

Navigation: Editors

Relationship Editor

Scroll Prev Top Next More

To open the relationship editor, you should double-click on the desired relationship on the Project explorer. This editor is divided in tree sections: Relationship properties, Relationship keys and Relationship options.

 

In the Relationship properties section, you may visualize or set the relationship name and its description, for future reference. A default relationship name is created automatically when adding a new relationship to the project, combining parent and child table names. The relationship name may be edited at any time.

 

In the Relationship keys section you may visualize or edit the relationship keys by selecting them from the available list.

 

Parent key: Lists all available keys (primary keys and indexes) from the parent table.

Parent table: This column shows all fields on the parent table which are part of the selected parent key. It is not possible to modify this data.

Child table: This column lists all fields on the child table that are compatible with the selected field on the parent table (same type). By default a new field listed as "field_name(new)" with the same name and type of the parent key is created and selected. It is possible to select any other available child field from the list.

 

In the Relationship options section, you are able to select the relationship behavior when a record on the parent table is deleted or updated:

 

No action: no action is taken when there are changes on the parent table. This is the default option.

Cascade: automatically deletes all records on the child table when a parent record is deleted. Example: Customer/Contact, when deleting a customer, all of its contacts are also deleted.

Set null: when a parent record is deleted, all child records related to it get this field set to null. Example: on the Person/Gender deletion, all people related to this record would be set to null.

Set default: similar to "set null" option, but instead of setting the field to null, it is filled with its default value.

 

When opening a relationship by double-clicking on a diagram, the Back to diagram button is enabled,  so you can easily return to the original diagram.