-
Notifications
You must be signed in to change notification settings - Fork 8
Entity Relationships
- 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
To see the current relationships, go to the Properties pane > Relationships table.
- Update the current relationship to change its relationship name and other attributes.
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.
- Create the other relationships between the "Person" and "Movie" entity.
- To show the relationship labels, go to the toolbar and click the "Show Labels" button.
Oopss! 😮 Look's like the labels didn't display well.
To fix this, go to View > Sugiyama.
Tada! ✨ You can now see labels orderly.
You can adjust it manually to look more presentable.
- 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
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.
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.
Congratulations! 🎉 You have successfully defined your Main Model.
Now, let's take a look at how the code generation works.