Skip to content

Entity Relationships

CIRCLES ARROWS LIMITED edited this page Oct 19, 2018 · 6 revisions

Creating Relationships

  1. Create a relationship between “Person” and “Movie” entity. First, select the “Person” entity and then right-click the “Movie” entity. Select Insert Relationship > (Source Property Type) Collection > (Target Property Type) Collection

Create Relationship

To see the current relationships, go to the Properties pane > Relationships table.

Current Relationships

  1. Update the current relationship to change its relationship name and other attributes.

Update Relationships

Now, the “Person” entity will have an “ActedIn” property with a collection type of Movie entity, and the “Movie” entity will have an “Actors” property with a collection type of Person entity.

Show Labels

  1. Create the other relationships between the "Person" and "Movie" entity.

Other Relationships

  1. To show the relationship labels, go to the toolbar and click the "Show Labels" button.

Show Labels

Oopss! 😮 Look's like the labels didn't display well.

To fix this, go to View > Sugiyama.

Show Labels

Tada! ✨ You can now see labels orderly.

Show Labels

You can adjust it manually to look more presentable.

Show Labels

  1. Let's create a relationship between “Movie” and “Genre” entity. Select the “Movie” entity and then right-click the “Genre” entity. Select Insert Relationship > (Source Property Type) Lookup > (Target Property Type) Collection

Manage Relationship

Manage Relationship

The “Movie” entity will have a “Genre” property with a lookup type, and the “Genre” entity will have a “Movies” property with a collection type.

Manage Relationship

To update the relationships of "Movie" entity, click the entity and go to the Properties pane and on the Relationships group, you can manually change its relationship details.

Manage Relationship

Congratulations! 🎉 You have successfully defined your Main Model.

Now, let's take a look at how the code generation works.