Caché Class Definition Reference
OnDelete
[Home] [Back] [Next]
InterSystems: The power behind what matters   
Class Reference   
Search:    

Specifies the action to take in the current table when a related object is deleted. This keyword applies only to a relationship property that specifies Cardinality as Parent or One. Its use is invalid in all other contexts.
Usage
To specify the action to take in the current table when a related object is deleted, use the following syntax:
Relationship relname As classname [ Cardinality = cardinality, Inverse = inverse, OnDelete = ondelete ];
Where ondelete is one of the following values. In this discussion, related record is a record or object belonging to the other side of the relationship, and referencing record is the record or object in this side of the relationship.
Details
This keyword defines the referential action that occurs when a record is deleted on the other side of a relationship.
Default
If you omit this keyword, then:
Example
Relationship Patient As DeepSee.Study.Patient [ Cardinality = parent, Inverse = DiagnosesAsChildren, OnDelete = cascade ];
See Also