Containment Relationships

From ER/Studio Data Architect
Jump to: navigation, search

Go Up to Creating and Editing Relationships

A containment relationship is used for nested objects within a supported database. For instance, if you have reverse engineered nested objects within MongoDB, these will be added with a containment relationship to the object they are nested within.

To create a new containment relationship

  1. On the Data Model Explorer, click the Data Model tab.
  2. Choose Insert > Relationships > Containment Relationship, this changes the cursor icon and allow you to select the objects in the main window with which to create the relationship.
  3. Click on the object containing the other object.
  4. Click on the object contained within the previously clicked object.

Double clicking on the relationship line will open the Containment Relationship Editor where you can edit settings.

Containment Relationship.png

The 1 indicates a single nested object; * indicates an array.

Changing a relationship type for containment relationships in Google BigQuery and MongoDB

Google BigQuery and MongoDB users can easily change a relationship type for containment relationships. While viewing a containment relationship that you want to change the relationship type, click Switch Relationship Class in the ribbon bar. The following actions occur:

  • If the line is referencing:
    1. ERDA removes the Foreign Key field/column in the child object/table.
    2. A dialog appears asking you to select the desired containing object, and offers Parent, Child, and Cancel options. Note that Child is the default.
    3. ERDA changes the relationship type to containing in the direction selected in the dialog.
    4. A new foreign key property is created in the Parent object.
  • If the line is containing:
    1. ERDA removes the Foreign Key field/column in the parent object/table.
    2. A dialog appears asking you to select the desired referencing object, and offers Parent, Child, and Cancel options. Note that Parent is the default.
    3. ERDA changes the relationship type to Referencing in the direction selected in the dialog.
    4. A new foreign key property is created in the Child object, propagating the primary key of the parent.

The following image shows this feature using Google BigQuery:

ERDA 200 Switch Relationship Class Google BigQuery.png

The following image shows this feature using MongoDB:

ERDA 200 Switch Relationship Class MongoDB.png

See Also