Link

Links within an application represent the relationship between its classes. This section introduces the process of creating a new link, and provides a detailed breakdown of its customization options.

Getting Started

Relationships between classes are defined by creating links in the class designer.

Starting in the Class Designer, click on the down arrow on the left side of the class you wish to work on. Next, expand the Links for the class. Click on Please select to choose the target class for the link. Click on the plus icon on the right of the textbox to create your link.

Class designer: Creating a link

There are different types of links.

One-To-One Class A can only have one instance of Class B and vice-versa.

One-To-Many Class A has several instances of Class B, but Class B can only be related to a single instance of Class A.

Many-To-Many Class A has several instances of Class B and Class B is related to several instances of Class A as well.

Common Attributes

The Common section contains general properties of a link. In this section, you can specify how the link is presented in your application by setting the name, description and other information.

Common attributes for links

Key

The parent link is used to specify the inheritance of abstract classes.

Name

The link name is a user-friendly name that is normally generated automatically and set to the target class by default. This value usually does not require modifications.

Changing the value for the name causes the link will be called the same in both classes. The Name field is compulsory when creating a link.

Description

The description is a short help text that could potentially be used as hover text for the link.

In the Link setup, you can configure the type and specifics of the link between the two classes.

Normally, Class 1 defines the origin class, while Class 2 defines the target class.

Field 1 identifies the field from Class 1 that should be used as a distinct identifier (foreign key) and normally should be set to the primary key of that class. Similarly, Field 2 specifies the distinct identifier (foreign key) for Class 2 and should be set to the primary key of that class.

Is Source

The source setting defines the direction of a link. By selecting Is Source for a class, you can allow a user to navigate from that class to the other one.

By selecting Is Source for both classes, the user is allowed to navigate in both directions.

NM Class

When configuring Many-To-Many link types, an extra intermediary table is required to cater for the complex relationship between both classes. The NM Class allows you to specify which table to use from the database. This table will be used to lookup the relations between the linked classes.

For more information about many-to-many data models, click on this link.

Advanced Attributes

In the advanced section of a link, you can further customize the how the link is processed by the platform by linking it to additional code and configuring additional options.

Advanced attributes for links

Controller

The controller specifies additional code pertaining to the link that is running in the background.

Constraint

Link constraints refers to the restriction of links.

Direction

The link direction can be used to differentiate between two links.

Type

The class designer takes care of setting up most properties of your link. However, in this property, you can explicitly define a link type as one-to-many or many-to-many.

However, using the NM Class in the Common Attributes of a link instead can greatly simplify the configuration when creating your classes.

OneToMany

In the link type “OneToMany” a real relationship between one to many instances can be configured.

Field
Required
Remarks

Type

Yes

The type of link. Must be “OneToMany”.

Class 1

Yes

The One class in One-To-Many. This is usually a main class.

Class 2

Yes

The Many class in One-To-Many. This is usually a dependent class.

Field 1

Yes

The identifying field of class 1 in class 1. This is usually the primary key.

Field 2

Yes

The identifying field of class1 in class 2. This is usually a foreign key.

ManyToMany

In the link type “ManyToMany” a real relationship between many to many instances over a third class can be configured.

Field
Required
Remarks

Type

Yes

The type of link. Must be “ManyToMany”.

Direction

Yes

The direction of the relation:

  • None: No specific direction is given.

  • Children: The direction is from class 1 (left) to class 2 (right).

  • Parents: The direction is from class 2 (right) to class 1 (left).

Class 1

Yes

The left hand Many class in Many-To-Many. This is usually a main class.

Field 1

Yes

The identifying field of class 1 in class 1. This is usually the primary key.

NM Class

Yes

The relating class in Many-To-Many. This is usually a class only used for the relationship.

NM Field 1

Yes

The identifying field of class 1 in nm class. This is usually a foreign key.

NM Field 2

Yes

The identifying field of class 2 in nm class. This is usually a foreign key.

Class 2

Yes

The right hand Many class in Many-To-Many. This is usually a main class.

Field 2

Yes

The identifying field of class 2 in class 2. This is usually a primary key.

Service

In the link type “ManyToMany” a virtual relationship between many to many instances over a integrated service can be configured.

Field
Required
Remarks

Type

Yes

The type of link. Must be “Service”.

Class 1

Yes

The left hand Many class in Many-To-Many. This is usually a main class.

Field 1

Yes

The identifying field of class 1 in class 1. This is usually the primary key.

Class 2

Yes

The right hand Many class in Many-To-Many. This is usually a main class.

Field 2

Yes

The identifying field of class 2 in class 2. This is usually a primary key.

Delete Behavior

Class-Designer option to not delete linked instances when deleting an instance. Following delete behavior options are available:

  • Delete (default): Deletes all linked instances.

  • Retain: Does not delete linked instances.

Conditions

Last updated

Was this helpful?