Class Definition Reference
Foreign Key Definitions
Describes the structure of a foreign key definition.
A foreign key defines a referential integrity constraint. When a table containing a foreign key constraint is modified, the foreign key constraints are checked.
You can add foreign key definitions to persistent classes. They are not meaningful in other kinds of classes.
Note that you can also enforce reference integrity by defining relationship properties that connect the classes.
A foreign key definition has the following structure:
ForeignKey name(key_props) References referenced_class(ref_index) [ keyword_list ];
(required) is the name of the foreign key. This must be a valid class member name
, and must not conflict with any other class member names.
(required) specifies the property or properties that are constrained by this foreign key. Specifically this property or properties must match the referenced value in the foreign table.
This is a comma-separated list of property names.
These properties must be in the same class that defines the foreign key.
(required) specifies the foreign table (that is, the class to which the foreign key points).
(optional) is a comma-separated list of keywords that further define the foreign key.
If this list is omitted, also omit the square brackets.
ForeignKey EmpKey(EmpId) References MyApp.Employee(EmpID) [ OnDelete = cascade ];
Content Date/Time: 2019-02-20 23:00:21