To define a connection between two classes use the keyword relation. This relation can have 1:1, 1:n or n:m cardinality. A relation can have its own properties.
A special case is a “self-relation”, when the two related classes are identic.
// relation without properties
// relation with properties
In order to facilitate the use of relations app.ducx implicitly defines the necessary attributes to have access from the relation instance to the class instances and from class instances to the relation instance. For the relation<ClassA, ClassB> Relation the implicitly defined attributes have the following names:
Table 9: Implicitly defined attributes for a relation
In case of the self-relation relation<Class> Relation:
Table 10: Implicitly defined attributes for a self-relation
If ClassA is marked as multiple, then classb_relation is a list: instances of ClassB can have a set of Relation instances with different instances of ClassA.
For instance, assume at a company several employees can be hired. This can be modeled as a 1:n relation called Employee between the Company and Person class. In our case, the contractid and membersince properties could describe the Employee relation.