Creating an association

Associations

Associations are used to manifest links between classes in the persistence model. The mapping rules applied to an association vary according to the cardinality of the association, its aspect (unidirectional or bidirectional) and the type of SQL mapping chosen.

Modifying the cardinality of an association

An association has two roles, one at each of its extremities. The cardinality of an association depends on the cardinality of these two roles.

To modify the cardinality of a role:

Relationship between the cardinality of roles and the cardinality of the association

Role 1 Role 2 Association
0..1 0..1 One To One
1..1 1..1 One To One | Not Null
0..1 0..* One To Many
1..1 1..* One To Many | Not Null
0..* 0..1 Many To One
1..* 1..1 Many To One | Not Null
0..* 0..* Many To Many
1..* 1..* Many To Many | Not Null

Defining foreign key names

According to the type of mapping chosen for the association, the names of the foreign keys used in the SQL model must be configured.

To modify the names of foreign keys:

Defining the name of a foreign key

Defining the name of the join table

If you choose to map an association to a join table at SQL model level, the name of the join table is defined in the following way: * If the “Persistent Name” property of the association is defined, the join table will be named after this property. * If this is not the case, the join table will be named from the name of the association.

Types supported at conceptual level

The SQL Designer module currently supports the following types for identifiers and properties:

The SQL Designer module currently supports the following types of collections (defined at association role level):