Skip to main content

Relationship definition between entities

Overview

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

The steps to define relationships between entities are explained below in the following order:

  • Type of association
  • Add association
  • Delete association
  • Change related settings
  • Add fields to relationships
  • Remove field from association
  • Redisplay relationships deleted from the class diagram

Image of metamodel including relationships between entities

Metamodel containing relationships between entities


Type of association

The types of relationships available in a metamodel definition are:

Change Shape TypeDescription
EmbeddedRelationships representing parent-child relationships and aggregation
ReferenceRelationships that represent usage and dependency relationships
DerivationAssociation that represents a trace relationship with the origin
GeneralizationAssociation representing inheriting characteristics
reference

Add association

We will explain how to add a relationship for each type of relationship.

Add ownership relationship

Adding and deleting ownership relationships between entities is equivalent to defining the structure of the model. For information on how to add and delete ownership relationships, please refer to Metamodel Definition > Model Structure Definition.

Add reference association

There are multiple ways to add reference relationships between entities: The first method is recommended.

  • Add reference relationships in class diagrams
  • Add new reference relationships while modeling
    • Add new reference relationships while modeling with ER diagrams
    • Add new reference relationships while modeling with forms
    • Add new reference relationships while modeling in tree grid

Below, we will explain the operating steps for each of the above methods.

Add reference relationships in class diagrams

To add reference relationships between entities using class diagrams:

Add reference relationship in class diagram

Operating instructions
  1. Display a class diagram that contains entities that have reference relationships with each other. If one entity is not in the same class diagram, use [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 referenced entity, drag the [▲] icons that appear on all four sides, and drop them onto the referenced entity.
  3. Once dropped, a pop-up will appear asking you to select the type of relationship, select Reference from the choices.
  4. This defines the reference relationships between the entities and allows you to add connectors to represent the relationships in the ER diagram's view definition.

Add new reference relationships while modeling with ER diagrams

To add a new reference relationship while modeling on an ER diagram, follow these steps:

Adding new reference relationships while modeling with ER diagram

Operating instructions
  1. Add the two models you want to connect the reference relationship to on the ER diagram.
  2. Select the entity you want to reference, then hold down the ctrl key and select the entity you want to reference.
  3. Click one of the following commands: (Both operations are the same)
    • Ribbon Profile > Diagram > Add Connector > Add Reference and Connector
    • Ribbon Profile > Metamodel > Relationship
    • Ribbon Add Shape > Add Shape > Add Connector > Add Reference and Connector
    • [Add Relationship...] in the context menu
  4. Click to display the [New ConnectorShape] dialog, set the items, and then press the [OK] button.
  5. This makes the following changes all at once and connects the association line between the two models:
    • Added reference relationships between entities to the metamodel
    • Define a connector that represents the relationship in the view definition of the ER diagram
    • Add reference relationships between models
note
  • New associations added to the metamodel are not automatically displayed on existing class diagrams. If necessary, please display it on the class diagram according to "Redisplaying relationships deleted from the class diagram" below.

Add new reference relationships while modeling with forms

To add a new reference relationship while modeling in a form, follow these steps:

Add a new reference relationship while modeling with a form

Operating instructions
  1. Select the reference model on the 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 operations are the same)
    • Ribbon Profile > Metamodel > Fields
    • Ribbon Profile > Form > Add New Fields
    • Ribbon Form > Form > Add New Fields
    • [Add New Field...] in the context menu
  3. Click the [...] button to the right of the [Data Type] setting item to open a finder to search for the referenced entity.
  4. Search for the referenced entity in the list on the finder and double-click it. The referenced entity will be entered in [Data Type].
  5. Select [Reference] from the setting item [Field Type], set other items, and then press the [OK] button.
  6. This makes the following changes all at once and adds fields on the form.
    • Added reference relationships between entities to the metamodel
    • Add a field representing the referenced model to the form's view definition

Add new reference relationships while modeling in a tree grid

To add a new reference relationship while modeling in a tree grid, follow these steps:

![Adding new reference relationships while modeling with tree grid](./images/add-reference relationship-treegrid.gif)

Operating instructions
  1. Select the reference model on the tree grid.
  2. Click one of the following commands to display the Add New Fields dialog. (Both operations are the same)
    • Ribbon Profile > Metamodel > Fields
    • Ribbon Profile > Form > Add New Fields
    • Ribbon Form > Form > Add New Fields
    • [Add New Field...] in the context menu
  3. In the same way as "Adding a new reference relationship while modeling with a form" above, set the items in the [Add New Fields] dialog, and then press the [OK] button.
  4. This makes the following changes all at once, allowing you to add the referenced model below the referencing model on the tree grid.
    • Added reference relationships between entities to the metamodel
    • Added a field that can display the referenced model below the referenced model in the tree grid view definition.

To add derived relationships using class diagrams, follow these steps:

![Add derived relationship](./images/add-derived relationship.gif)

Operating instructions
  1. Add entities that have a derivation relationship to each other to the class diagram.
  2. Move the pointer to the entity to be derived, drag the [▲] icons that appear on all four sides, and drop it on the entity you want to derive from.
  3. Once dropped, a pop-up will appear asking you to select the type of relationship, select Derivation from the choices.
  4. This defines derivation relationships between entities and allows you to add derivation and trace relationships between models during modeling.
tip
  • When defining derived relationships, we recommend that you add a new class diagram to define only the derived relationships, separate from the existing class diagram. Many derivation relationships are defined across the metamodel, so if they are defined separately in multiple class diagrams, it becomes difficult to understand the excess or deficiency of derivation relationships in the entire metamodel.

To add inheritance relationships between entities, use a class diagram:

Add inheritance relationship

Operating instructions
  1. Add entities that have an inheritance relationship to each other to the class diagram.
  2. Move the pointer to the entity you want to inherit from, drag the [▲] icons that appear on all four sides, and drop them onto the entity you want to inherit from.
  3. Once dropped, a pop-up will appear asking you to select the type of association, select Generalization from the choices.
  4. This defines an inheritance relationship between the entities, making the fields of the inheriting entity available to the inheriting entity.

Delete association

There are multiple ways to remove relationships between entities:

  • Remove association from metamodel
  • Remove the association from the class diagram (hide it in the class diagram without removing it from the metamodel)

Note that the method for deleting relationships is the same regardless of the type of relationship.

Remove association from metamodel

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

Delete relationship from metamodel

Operating instructions
  1. If you want to delete an association used in a model, first delete the association from the model.
  2. Select the association you want to delete from the metamodel in the class diagram and select Delete From Model from the context menu.

You can also remove associations from the metamodel by following these steps:

Other operating instructions
  1. Select the relationship you want to delete in the Profile Navigator.
  2. Review the details of the selected association in the Inspector.
  3. Execute [Delete] from the context menu or press the delete key.
note
  • Owned and inherited relationships are not displayed in the profile navigator, so delete them in the class diagram.
  • If the relationship you want to delete is not displayed on the class diagram, follow the instructions below to unhide relationships deleted from the class diagram to redisplay the hidden relationships before deleting them.

Delete an association from the class diagram

To remove and hide some relationships from a class diagram, follow these steps:

Delete relationship from class diagram

Operating instructions
  1. Select the relationship to be deleted from the class diagram and execute [Delete From Diagram] from the context menu or press the delete key.

To change the number of records in an ownership relationship or change a reference relationship to a bidirectional reference, use the Inspector to do the following:

Change relationship settings

Operating instructions
  1. Click View > Pane > Inspector from the ribbon to display the Inspector on the right side of the screen.
  2. Select the desired relationship in the class diagram or profile navigator.
  3. Select Metamodel from the tabs at the top of the inspector.
  4. To change the number of ownership-related data to constrain the number of models that can be added to children, change Multiplicity in the Fileds group.
  5. If you want the reference relationship to be editable only from the referencing model, uncheck the IsTwoWay checkbox in the Relationship Class group.
note
  • To see the field names that maintain relationships in the class diagram, turn on the [Home] > [Class Diagram] > [Show Label] toggle button from the ribbon.
  • Editing the label displayed on the relationship line will change the field's Display Name and Field Name.
reference

Add field to association

Add fields to reference and derived relationships using the Inspector.

Operating instructions

Remove field from association

To remove fields from lookup and derived relationships, use the Inspector just as you would add them.

Operating instructions

Redisplay the association deleted from the class diagram

To unhide relationships that you deleted from a class diagram, or to display relationships that you added outside of a class diagram, do the following from a class diagram:

Unhide relationships deleted from class diagram

Operating instructions
  1. Select the entities with relationships in the class diagram and select [Show hidden relationships] from the context menu.