Skip to content

RelationCardinality

RelationCardinality = "one-to-one" | "one-to-many" | "many-to-one" | "many-to-many"

Cardinality of a Relation as declared from its from side.

  • 'one-to-one': each side holds at most one target.
  • 'one-to-many': one from-Item relates to many to-Items; the to-Item holds one from-Item.
  • 'many-to-one': many from-Items relate to one to-Item; the from-Item holds one target.
  • 'many-to-many': both sides select many.

The Runtime exposes a one Relation instance on the from side for 'one-to-one' and 'many-to-one' and a many selector otherwise; the to side is the inverse.

Relate items