Creating Entities with Relationships

You can create new entities in an ER diagram using the context menu and new relationships with an entity's carousel. If you want to create relationships to an entity that already exists, drag this entity from other tool window and drop it in the diagram.

Creating a New Entity

How to proceed

  1. Place the mouse pointer at the chosen position in the diagram and select the entity template from the mini toolbar in the context menu.

    A new entity is created in the diagram. The name of the entity is automatically selected to be edited.

  2. Enter the name for the entity and confirm with the [Enter] key.

Tip

You can create various element types in Innovator diagrams in this way. The types of elements available in the mini toolbar primarily depend on the diagram type used, the model template used and the user role selected in a model.

Adding and Existing Entity

How to proceed

  • Drag the entity in another tool window and drop it where you want it in the diagram.

    An entity node that shows the existing entity is created in the diagram.

Creating a New Relationship

Prerequisites

The default profile contains various create templates for relationships; these are available in the carousel. These vary by and large in their cardinalities. These create templates are structured in such a way that the entity first selected contains the referenced key and the entity selected next is assigned the foreign key for the relationship.

Whether a relationship gets a foreign key and whether both entities affected own this foreign key depends on the relationship cardinalities. Only one entity with no more than one incoming relationship can contain the foreign key for this relationship. m:n relationships do therefore not get a foreign key.

How to proceed

  1. Select an entity in the diagram.

    The carousel appears next to the entity.

  2. Drag the desired relationship from the carousel and drop the icon on the partner entity. This can be the entity you first selected.

    The new relationship is created in the diagram. If the first entity has a key and cardinalities of the relationship permit a foreign key, this then automatically appears in the second entity. An attribute in the foreign key then exists for each attribute of the referencing key in the second entity.

Creating a New m:n Relationship as R Type

Prerequisites

You require an additional table when realizing an m:n relationship in a relational database. If you want to create a data model that will be consistently mapped to a database, then use an R type when creating an m:n relationship. From a business point of view, an r type is a relationship but is created in the model as an entity that links both entities with an identifying foreign key.

How to proceed

  1. Select an entity in the diagram.

    The carousel appears next to the entity.

  2. Drag the desired r type from the carousel and drop the icon on the partner entity. This can be the entity you first selected.

    An entity is created as an r type in the diagram. The r type has a hierarchical relationship to both entities and, as with creating a relationship, suitable foreign keys and foreign key attributes. The name of the r type is automatically selected to be edited.

  3. Enter the name for the r type and confirm with the [Enter] key.

Copying Related Entities

Entity relationships are also automatically copied when copying entities which are related to one another. Pasting creates the entities and their relationships in the selected package as standard.

If the configuration does not permit relationships in the selected package as content, then entity relationships are redirected to a suitable package using create defaults.