Skip to main content

Relations

Definition of https://dictionary.cambridge.org/dictionary/english/relation[relation] is "the way in which two people or groups of people feel and behave towards each other". By replacing people or groups of people with entity we can than talk about how do entities "feel and behave" with each other.

Types of relations#

One to One#

Describes relation where only one entity A exists for one entity B

One to Many#

Describes relation where one entity A can have one or more than one entity B

Relation Example#

User - User Group relation

Lets explain this relation. Relation between User and User Role from perspective of User states that single user can have many User Role records that are referenced by roles field. Other way arround when we look at relation from User Role entity relation states that single User Role record can have multiple User entities referenced by users field.

This type of relation is called

Many to Many#

Describes relation where one entity A can have one or more than one entity B, as well as one entity B can have one or more entity A.

Recursive#

recursive relation

On picture above you can find recursive relation. This type of relation is referencing same entity. Entities with recursive relations represent tree like structures in EYWA.