User Tools

Site Tools


softvelocity_datadictionary_editor_relationeditor.htm
Navigation:  Dictionary Editor >====== New/Edit Relationship Properties Dialog ====== Previous pageReturn to chapter overviewNext page

relationtabs_shg.jpgadm6 optionsadm6 commentsadm6 general

Click on a TAB to see its help

Set relationships between files in this dialog. The relationships appear in the Related Files list on the Dictionary dialog, for the currently selected file. When completing this dialog, work from the top down. Start with the Relationship for selected file group box.

General

Type

Set the relationship type by choosing 1:Many or Many:1 from the drop down list.

Key

Depending on the relationship type selected, choose a primary or foreign key from the drop down list. The choices in the drop down are the keys previously defined for the currently selected file.

Depending on the relationship type you choose for the selected file, the label of the next group box is Parent or Child (respective to 1:Many or Many:1):

Related File

Choose another file from the dictionary to relate to the selected file.

Key

Depending the relationship type you choose for the selected file, the label for this drop down box will be either Primary or Foreign. Select a previously defined key for the related file from the drop down box.

Field Mapping

This group box displays two lists, each showing a key, and the field in the related file which “maps” to it. If the key field names of each file match each other, then just press the Map by Name button (below), and Dictionary Editor will automatically link the fields. If they do not, double click on each item in the list boxes, then select a field from the related file that links to the key, in the Select a Field dialog.

Map By Name

Automatically defines links based on similarly named fields in each data file.

Map By Order

Automatically defines links based on the order in which fields are defined in each data file.

NoteBox.jpg

Alternatively, you can map each field manually by double-clicking the field name in the Field Mapping list.

After choosing all other options, set the options in the Referential Integrity Constraints group box. The Application Generator automatically generates the code that enforces your selections.

Referential Integrity requires that a foreign key cannot contain any value which has no match in the primary key. This raises potential problems when the end user wishes to change or delete the primary key record.

The On Update and On Delete drop down boxes each offer the following choices:

No Action

Instructs the Application Generator not to generate any code to maintain referential integrity.

Restrict

Instructs the Application Generator to disallow the user from deleting an entry, if the value is used in a foreign key. For example, if the user attempts to change a primary key value, the generated code attempts to check for a related record with the new value, changes it back if necessary, then loops back to the entry dialog so that the user can enter another value.

Cascade

Instructs the Application Generator to update or delete the foreign key record. For example, if the user changes a primary key value, the generated code changes the values in the foreign key that referenced the primary key. If the user deletes a primary key value, the code deletes the foreign key value, too.

Clear

Instructs the Application Generator to change the value in the foreign key to blank or zero.

TipBox.jpg

The following server settings have the same effect as the No Action setting (no code is generated); however, they can provide an indication that RI is enforced elsewhere, and their values can be used to trigger template generated scripts for the server.

Restrict (Server)

Tells the Application Generator that the back-end server will prevent the user from deleting or changing an entry if the value is used in a foreign key.

Cascade (Server)

Tells the Application Generator that the back-end server will update or delete the foreign key record.

Clear (Server)

Tells the Application Generator that the back-end server will set the foreign key to null or zero.

Comments

Allows you to enter a text description describing the relationship. The description is solely for your convenience, and has no effect on the application. It is useful for situations in which other programmers may pick up your code later, or for when you expect to return to the project after a long period of time since you last looked at it.

This tab also contains read-only information about the selected dictionary element. It includes the date that it was created and last modified, version number, and user rights to the target element.

Options

User Options

The IDE supports 3rd party pre-defined DCT options. These options are stored in .dctopt files.

The dctopt file is an XML file with a schema of dctopt.xsd.

Any dctopt file in <;clarion>/data/DictionaryOptions or <;userdata>\SoftVelocity\Clarion\7.0\DictionaryOptions directories will be read by the IDE.

The default for SoftVelocity is <;Clarion Root>\data\DictionaryOptions\SoftVelocity.dctopt.

The IDE will also automatically detect changes in these files and update the list of available options

To add a new entry, press the Insert button in the Options toolbar. In the subsequent dialog, you have four choices: Bool, String, Integer or Predefined. Bool is for Boolean type expressions, such as On or Off, True or False, etc.

If you choose String, the value has an ellipsis button to open a text window. This allows you to enter a string value. The maximum length for any option is 4096 characters.

If you select Integer, the user-defined option will be a numeric value.

Choose Predefined to get a property that is defined. This is used to set pre-defined properties for use later. A drop list is provided allow you to choose from the list. Selecting a property from this list not only adds the property but also activates it for use.

Follow the instructions provided with your add-on template set.

See Also:

How to Design Your Dictionary and Database

How to Define File Relationships and Referential Integrity

softvelocity_datadictionary_editor_relationeditor.htm.txt · Last modified: 2021/04/15 15:57 by 127.0.0.1