Inherited Items
A child relationship inherits the following items from the parent:
- All attributes
-
All methods
-
All triggers
A child relationship can override a trigger defined for its parent for the same event.
-
Governing rule
A child relationship can override a rule by defining its own rule. In such a case, the parent rule doesn't govern the child relationship. For example, if a rule lists the parent relationship as a governed relationship, then this rule can also govern the child relationship. In such a case, the child relationship is not listed as a governed relationship in the rule definition.
-
Allowed from and to end business types
For example,
add relationship parentrel from type T1 to type T2;
add relationship childrel derived parentrel; |
If the parent relationship, “parentrel,” allows the type “T1” to be on the FROM end and the type “T2” to be on the TO end, then the child relationship, “childrel,” will allow “T1” to be on the FROM end and the type “T2” to be on the TO end. Inherited from and to business types can be specialized.
From and To Clauses with Derived Clause
A child relationship can define its own from or TO end business types or both. These types must be derived from the types listed by the parent relationship. If not, an error will occur.
For example:
add relationship parentrel from type T1 to type T2;
add relationship childrel from type T1child to type T2child derived parentrel; |
The child relationship, “childrel,” allows the type “T1child” to be on the FROM end. “T1child” must be derived from “T1” since “T1” is defined by the parent relationship, “parentrel.” Only “T1child” will be allowed to be on the FROM end in “childrel.” “T1” will NOT be allowed.
Subclauses Defined by the To and From Clauses
The subclauses defined by the to and from clauses are also inherited by the child relationship:
-
meaning
-
cardinality
-
revision rule
-
clone rule
-
propagate modify
-
propagate connection
These subclauses are ALWAYS inherited and cannot be overridden (besides the meaning subclause). The meaning subclause can be overridden. The only way to redefine the other subclauses in a child is to redefine them in the parent.