Skip to main content

Relationship definition between entities

Overview

The Next Design metamodel allows you to define relationships between entities in addition to ownership relationships that represent parent-child relationships.

The following steps guide you through defining the relationships between entities:

  • Related types
  • Add association
  • Delete association
  • Change related settings
  • Add a field to the association
  • Remove fields from associations
  • Redisplay the associations deleted from the class diagram

Image of metamodel including relationships between entities

Metamodel including relationships between entities


The types of associations available in the metamodel definition are:

KindDescription
EmbeddedRelationships that represent parent-child relationships and aggregations
ReferenceRelationships that represent usage and dependency relationships
DerivationRelationship that represents the trace relationship with the origin
GeneralizationRelationships that represent inheritance of characteristics
reference
  • For more information, see Reference> related-types-and-details.md.

Add association

Explains how to add a relationship for each type of relationship.

Adding/removing ownership relationships between entities is synonymous with defining the structure of a model. See Metamodel Definition> Model Structure Definition for how to add/remove ownership.

Add reference association

There are several ways to add reference associations between entities: The recommended method is the first method.

  • Add reference association in class diagram
  • Add new reference associations while modeling
    • Add new reference associations while modeling with ER diagram
    • Add new reference associations while modeling in document form
    • Add new reference associations while modeling in the tree grid

The operation procedure is explained below for each of the above methods.

Add reference association in class diagram
To add reference associations between entities using a class diagram, do the following:

Add reference association in class diagram

Operation procedure
  1. Display a class diagram that contains each other's entities that make reference associations. If one of the entities is not in the same class diagram, then Metamodel Definition> Model Structure Definition> Add Entity> Add Existing Entity to Class Diagram (./model-structure-definition#model) -Structure-definition--add-exist-entity-to-class-diagram) to add the entity to the class diagram.
  2. Move the pointer to the referencing entity, drag the [โ–ฒ] icon displayed in the four directions, and drop it on the referencing entity.
  3. When dropped, a pop-up will appear where you can select the relevant type and select Reference from the choices.
  4. This defines the reference relationship between the entities and allows you to add a connector that represents the relationship to the view definition in the ER diagram.
Add new reference associations while modeling with ER diagram
To add a new reference association while modeling on an ER diagram, do the following:

Add new reference associations while modeling with ER diagram

Operation procedure
  1. Add two models on the ER diagram for which you want to make a reference association.
  2. Select the referenced entity, then hold down the ctrl key and select the referenced entity.
  3. Click one of the following commands. (Both have the same behavior)
    • Ribbon Profile> Diagram> Connector> Add Reference and Connector
    • Ribbon [Profile]> [Metamodel]> [Relationship]
    • Ribbon [Shape]> [Shape]> [Connector]> [Add Reference and Connector]
    • Add Association ... in the context menu
  4. Click to display the [New Connector Shape] dialog, set the items, and then click the [OK] button.
  5. This will make the following changes at once and connect the related lines between the two models.
    • Added reference relationships between entities in the metamodel
    • Define a connector that represents a connection to the view definition of the ER diagram
    • Add reference relationship between models
note
  • New associations added to the metamodel will not automatically appear in existing class diagrams. If necessary, display it on the class diagram according to "Redisplay the association deleted from the class diagram" below.
Add new reference associations while modeling in document form
To add a new reference association while modeling in a document form, do the following:

Add new reference associations while modeling in document form

Operation procedure
  1. Select the model to refer to on the document form (select a model other than the one displayed in the grid).
  2. Click one of the following commands to display the Add New Fields dialog. (Both have the same behavior)
    • Ribbon Profile> Metamodel> Filelds
    • Ribbon Profile> Form> Add New Fields
    • Ribbon [Form]> [Form]> [Add New Fields]
    • Add new field in context menu ...
  3. Click the [...] button at the right end of [Data Type] of the setting item to open the finder to search for the referenced entity.
  4. Find the referenced entity in the list on the Finder and double-click it to enter the referenced entity in Data Type.
  5. Select [Reference] from [Field Type] of the setting items, set other items, and then click the [OK] button.
  6. This will make the following changes at once and add the field on the document form.
    • Added reference relationships between entities in the metamodel
    • Added a field to represent the referenced model in the view definition of the document form
Add new reference associations while modeling with tree grid
To add a new reference association while modeling in the tree grid, do the following:

Add new reference associations while modeling with tree grid

Operation procedure
  1. Select the model to refer to on the tree grid.
  2. Click one of the following commands to display the Add New Fields dialog. (Both have the same behavior)
    • Ribbon Profile> Metamodel> Filelds
    • Ribbon Profile> Form> Add New Fields
    • Ribbon [Form]> [Form]> [Add New Fields]
    • Add new field in context menu ...
  3. Set the items in the Add New Fields dialog, and then press the OK button, as in "Adding a new reference association while modeling in a document form" above.
  4. This allows you to make the following changes at once and add the referenced model below the referencing model on the tree grid.
    • Added reference relationships between entities in the metamodel
    • Added a field that can display the referenced model below the referencing model in the view definition of the tree grid.

To add a derivation association using a class diagram, do the following:

Add derivation related

Operation procedure
  1. Add each other's entities that connect the derivation associations to the class diagram.
  2. Move the pointer to the entity to be derived, drag the [โ–ฒ] icon displayed in the four directions, and drop it on the entity from which it is derived.
  3. When you drop it, a pop-up will appear to select the related type, and you can select Derivation from the choices.
  4. This defines the derivation relationships between the entities and allows you to add derivation and trace relationships between the models during modeling.
tip
  • When defining a derivation association, it is recommended to add a new class diagram to define only the derivation association, in addition to the existing class diagram. Since many derivation relationships are defined across the metamodel, it is difficult to understand the excess or deficiency of derivation relationships in the entire metamodel if they are defined separately in multiple class diagrams.

To add inheritance associations between entities, use the class diagram as follows:

Add Inheritance

Operation procedure
  1. Add each other's entities that make an inheritance relationship to the class diagram.
  2. Move the pointer to the inherited entity, drag the [โ–ฒ] icon displayed in the four directions, and drop it on the inherited entity.
  3. When dropped, a pop-up will appear where you can select the related type and select Generalization from the choices.
  4. This defines the inheritance relationship between the entities and makes the fields of the inheriting entity available to the inherited destination.

Delete association

There are several ways to remove associations between entities:

  • Remove associations from metamodel
  • Remove associations from class diagram (hide them in class diagram without removing them from metamodel)

The method for deleting associations is the same regardless of the type of association.

Remove associations from the metamodel

To remove an existing association from the metamodel in a class diagram, do the following:

Delete associations from metamodels

Operation procedure
  1. If you want to remove the association used in the model, remove the relevant association from the model beforehand.
  2. Select the association you want to delete from the metamodel in the class diagram and run Delete From Model from the context menu.

You can also remove the association from the metamodel by following the steps below.

Other operating procedures
  1. Select the association you want to delete in the Profile Navigator.
  2. Review the relevant details selected in the Inspector.
  3. Execute [Delete] from the context menu, or press the delete key.
note
  • Ownership and inheritance relationships are not visible in the profile navigator, so delete them in the class diagram.
  • If the association you want to delete is not displayed in the class diagram, redisplay the hidden association and then delete it according to "Redisplay the association deleted from the class diagram" below.

Remove associations from class diagram

To remove some associations from the class diagram and hide them, do the following:

Delete association from class diagram

Operation procedure
  1. Select the association you want to delete from the class diagram and execute [Delete From Diagram] from the context menu or press the delete key.

To change the number of ownership-related data and change reference-related to bidirectional references, use the Inspector as follows:

Change related settings

Operation procedure
  1. Click View> Pane> Inspector from the ribbon to display the Inspector on the right side of the screen.
  2. Select the target association in the class diagram or profile navigator.
  3. Select Metamodel in the tab at the top of the Inspector.
  4. To change the number of ownership-related data to limit the number of models that can be added to the child, change Multiplicity in the Filelds group.
  5. To allow reference associations to be edited only from the referencing model, uncheck the IsTwoWay checkbox in the Relationship Class group.
note
  • To see the field names that hold the association in the class diagram, turn on the Home> Class Diagram> Show Label toggle button from the ribbon.
  • Editing the label displayed on the related line changes the Display Name and Field Name of the field.
reference

Add fields to associations

Use the Inspector to add fields to reference-related and derived-related relationships.

Operation procedure

Remove fields from associations

To remove a field from a reference-related and derived-related relationship, use the Inspector as you would add it.

Operation procedure

Redisplay the association deleted from the class diagram

To redisplay the associations that you deleted from the class diagram or to display the associations that you added outside the class diagram, follow these steps from the class diagram.

Redisplay deleted associations from class diagram

Operation procedure
  1. Select the relevant entity in the class diagram and run Show Hidden Relationships from the context menu.