Data Dictionary Table Structures

The Structures tab page is used to define the database structure with respect to the current data dictionary's table. The data dictionary will use this structure to perform certain checks and table locks during save and delete operations.

Before a save or delete is performed in a data dictionary structure, the entire structure is validated to make sure that it is complete. If the validation fails, the database change is canceled. This protects against design errors. The lists of all expected parent and child tables are compared to the actual data dictionary object structures in your views to ensure structural integrity. The validations all occur during an unlocked state.

Automatic Maintenance

Normally, you will not need to adjust the table structure lists. When a data dictionary is created, then the lists are initialized with required child and parent tables according to the currently defined database relationships. As you edit the database relationships in Table Editor, the appropriate adjustments are made to the affected data dictionary classes.

Data Dictionary Subclasses and Table Structures

If you are editing a subclass of a 'concrete' data dictionary class i.e. you have multiple class layers for a given table's data dictionary, or an alias table's data dictionary, then these table structures are read-only. An alias table's relationships are configured by setting the Field_Related_FileField property.

Only top-level concrete data dictionary classes can define a table structure. A top-level concrete data dictionary is the class where the Set Main_File statement is declared that binds the data dictionary class to a particular table.

Required Child Tables

This grid lists all of the child tables whose data dictionaries should be correctly connected before a delete operation can be performed in a view. Normally, this list will contain all of the directly relating child tables of the current table.

Enter each required child table, or select the table names from the combo list.

Required Parent Tables

This grid lists all of the ancestor tables whose data dictionaries should be correctly connected before a save operation can be performed in a view. Normally, this list will contain all of the directly related parents of the current table.

Enter each required parent table, or select the table names from the combo list.

Nulls

Check the Nulls option to allow null relationships to the selected parent table.

This sets the ParentNullAllowed property in the data dictionary class.

Commit

Check the Commit option to ensure that once a parent record has related to a record in this table, then that connection cannot be changed. For example, say you have an Order Header table with a related Customer table. If the Customer 'commit' option is selected, then once you save a customer association with a given order header record, the customer cannot be changed.

This sets the ParentNoSwitchIfCommitted property in the data dictionary class.

Cascade

Check the Cascade option to specify if the child table will allow its records to be deleted as part of a cascade delete.

This sets the CascadeDeleteAllowed property in the data dictionary class.

Del Null

Check the Del Null option to specify if the child table's records should be deleted or have its child to parent relationship set to null.

This sets the CascadeDeleteNull property in the data dictionary class.

Externally Updated Tables

Any data dictionary code you write that updates a non-related table while the data dictionary has locking control should be added to the External Structure list. Failure to do this will raise locking errors when your code tries to commit a save to the external table.

The data dictionary events that are sent while the data dictionary has locking control are: Update, Backout, Creating, Deleting, Validate_Save and Validate_Delete. For more information, see Defining Data Dictionary Events.

Another common case where a table needs to be added to this list is when you are using a non-related table to increment values for an auto-incremented column. Note that if you use Data Dictionary Modeler to define the auto-increment property then the referenced tables are automatically added to this list. For more information, see Auto-Increment column attribute.

Enter each required parent table, or select the table names from the combo list.

The Lock Mode fine-tunes exactly when the table should be locked during data dictionary operations. Select a lock mode from the combo list provided.

DD_Lock_On_All: The table will be locked on all save and delete operations by the data dictionary.

DD_Lock_On_Delete: The table will be locked only during delete operations by the data dictionary.

DD_Lock_On_Save: The table will be locked only during save operations by the data dictionary.

DD_Lock_On_New_Save: The table will be locked only during saving-to-create-a-new record operations by the data dictionary.

DD_Lock_On_New_Save_Delete: The table will be locked only during saving-to-create-a-new record or delete operations by the data dictionary.

Lock mode only affects locking for embedded database tables.

Toolbar

Rebuild

Click Rebuild to erase the current Required Child and Required Parent Table grids and repopulate them according to the defined table relationships in this database.

Add Table

Click Add Table to add a new table to the last row of the current grid.

Keyboard shortcut: (Ctrl+A)

Remove Table

Click Remove Table to delete the currently selected table from the grid.

Keyboard shortcut: (Ctrl+D)

Foreign Field Options

Within your application's data entry objects (DEOs) the Entry_Item command binds a table column value to a form or to a column within a grid. This table will either be the main file of the DEO’s Data Dictionary, or it will be a parent table. When used as a parent table, the Entry_Item is considered to be a connected to a "foreign field."

For a complete introduction to the concept of foreign field data dictionary properties, see Defining Data Dictionary Foreign Field Attributes.

The foreign field option groups on this tab page allow you to define special data dictionary properties when this data dictionary is providing foreign field services in this way.

Foreign-field columns can be divided into three categories. Those are:

Key Foreign Field Options

A Key Foreign Field is any column for which the Protect Value (key) attribute is set to true. Normally, these are the columns that participate in your table's primary key index.

Indexed Foreign Field Options

An Indexed Foreign Field is any column that is not a key field and participates in one or more of the table’s indexes.

Default Foreign Field Options

A Default Foreign Field is any column that is not a key field or an indexed field.

See Also

Defining Data Dictionary Parent, Child and External Relationships

Defining Data Dictionary Foreign Field Attributes

Data Dictionary Modeler

Data Dictionary Column Properties

Data Dictionary Validation Objects

Data Dictionary Problems