Referential Integrity

Determines whether referential integrity should be maintained in the database (rather than by Uniface). Valid values are T or F (default).

Value

Description

T

The database is responsible for maintain referential integrity. In this case, Uniface performs a series of checks to ensure that referential integrity scripts can be generated for this relationship by the Create Script utility.

F

Uniface is responsible for maintaining referential integrity.

Description

When compiling the model, Uniface performs the following checks to ensure the relationship is valid:

  • The One and Many entities in the relationship are both stored in the DBMS. If the Database Behavior property is set to N (Not in Database), the relationship is not valid.

  • The entities defined in the relationship cannot be defined as included entities.

  • The One Entity and the Many Entity must both have a supertype definition. The supertype name is the name of the table.

  • The key number specified in the relationship must refer to an existing primary key or candidate key of the one entity.

  • The foreign key fields must be specified in the relationship.

  • The number of fields in the key of the One Entity must be equal to the number of foreign key fields specified in the relationship.

  • The key fields of the One Entity must all be stored in the database (that is, the Is External property is set to T).

  • The foreign key fields of the Many Entity must also be stored in the database.

  • For each foreign key in the Many Entity, the data type and field interface definition must be identical to the corresponding primary key in the One Entity. Fields in the foreign key and in the primary key must correspond in exactly the same order.

If any of these checks fail, the relationship cannot be used to generate SQL scripts.

Applies To

Related Topics