If you would like to upgrade to a newer long-term support version of Studio Pro, see Moving from Mendix Studio Pro 8 to 9.

Association Tab Properties

Last modified: August 20, 2024

Introduction

There are two ways to edit the properties of an association. This document describes the properties you can edit from the Associations tab in the entity properties. If you want to edit the association as described in Association Properties, you can click Edit to open the association properties dialog.

For more information on associations, see Associations.

Properties

An example of the Associations tab of the entity properties is represented in the image below:

Associations in the Association tab have the following properties:

You can sort the list of associations by any of these properties (ascending or descending) by clicking the column titles.

Name

The name of the association is used to refer to it. For example, in forms or microflows.

Type

This property defines whether an association is a reference (single) or a reference set (plural).

Value Description
Reference (default) Single: an object of the owning entity refers to zero or one objects of the other entity.
Reference set Plural: an object of the owning entity refers to zero or more objects of the other entity.

Owner

This property defines whether an association has one or two owners. If there is one owner, the owner is located at the start of the arrow.

Value Description
Default (default) Only one entity is the owner (the parent).
Both Both entities are owners.

Ownership is important as it defines two aspects of an association:

  • how cardinality (many or one) is controlled
  • where the association is recorded

Cardinality

Cardinality refers to counting the number of associations an object can have. To ensure that an object can count the occurrences of a particular association it needs to have ownership of the association.

So, for a one-to-many association the many end owns the association to ensure that it can only associate with one object. For a one-to-one association, both ends own the association. For a many-to-many relationship cardinality is not important.

Association Recording

An association is recorded in the object which owns it. If both objects own the association, then the association is recorded with both objects. You can see examples of where the associations are recorded in the Association Examples section of Associations.

Where the association is recorded has an important impact on the user of reference and reference set selectors in your app. The selector can only be inside a data view containing the owning object. This is because it is only when you commit the owning object that the association is recorded.

For example, imagine you have a many-to-many association, Customer_Group, between Customer and Group owned by the Customer entity. You can put an input reference set selector to select Groups from within a Customer data view. However you cannot put an input reference set selector to select Customers from within a Group data view.

Selecting Group objects through an input reference set selector in a Customer data view

If both ends own the association, you can overcome this limitation. However, this has to be balanced by the overhead associated with having to commit all entities where the association is recorded. Therefore, it is recommended that many-to-many relationships are owned by the Default entity, unless there is a strong business reason for needing to add the association from either end in your Mendix app.

Type and Owner Relationship with Multiplicity and Navigability

Type and Owner properties of an entity are related to Multiplicity and Navigability properties of an association. When you change Type or Owner, you change Multiplicity and Navigability as well.

You can find the correspondence between Type/Owner and Multiplicity/Navigability in the table below.

Multiplicity Navigability Type Owner
One-to-one Reference Both
One-to-many Reference Default
Many-to-many X objects refer to Y objects Reference set Default
Many-to-many X and Y objects refer to each other Reference set Both

For more information on multiplicity and navigability, see the Multiplicity and Navigability sections in Association Properties.

Parent/Child

Parent and child settings show you the direction of the association. Parent defines the entity the association starts from, and child defines the entity the association ends with.

Read More