- We first create Entity Model in Model Explorer. Right click on the Model Explorer and select Model > New Model.
Create entity model in Model Explorer
- Enter the name as Entity Model.
Input "Entity Model" in model specification dialog box
- Now let's create entity relationship diagram under Entity Model. Right click on the Entity Model and select Diagram > Database Modeling > Entity Relationship Diagram.
Create entity relationship diagram under "Entity Model"
- Develop the following entity relationship diagram.
Device support history ER diagram
- Repeat the above steps to create the following entity relationship diagram under Entity Model.
Device purchase ER diagram
- Once the entity relationship diagrams are ready, we can then generate class diagrams from our entity relationship model. Select Tools > Object-Relational Mapping (ORM) > Synchronize to Class Diagram.
Select "Synchronize to Class Diagram" menu item
- The Synchronize form Entity Relationship Diagram to Class Diagram dialog will be shown. The entity relationship diagrams in your project shows on the left hand side of the table, and the target class diagram shows on the right hand side.
ER diagram to UML class diagram mapping dialog box
- Click on the entity relationship diagram cell and the preview will be show up.
Preview ERD diagram
- You can name the target class diagram directly in the class diagram cell, or you can synchronize to existing class diagram (if any).
Assign meaningful name to UML class diagram
- Press OK to proceed.
- Now the Synchronize to Class Diagram dialog will show up. The mapping between entity name and class name, also the column name and attribute name will be listed in the dialog. Let's change the name of the User class to Customer. And change the attribute name from firstname to firstName.
Entity column to class attribute mapping table
- We can specify the target for storing the output class diagram. Select Specify... in the Target Parent combo box.
Selecting target model
- Select the root node in the tree and press the New Model button. Name the model as Class Model.
Create "Class Model"
- Press OK to proceed.
- Now the class diagrams being generated.
Generated UML class diagrams
- Let's try to modify the documentation of the class PriorityType.
Modify "Priority Type" class's documentation
- You can synchronize the documentation from class model to the associated entity model by right click on the diagram and select Utilities > Synchronize Class Documentation to ERD.
Synchronize class documentation to ER Diagram
- Synchronize Class Documentation to ERD dialog will list class model which contain different documentation with the entity model.
- Click on the entity PriorityType in the list and the differences of documentation between class and entity model will be shown.
Synchronize class documentation dialog box
- Select the checkbox under Synchronize column to specify the model you would like to synchronize their documentation.
Check synchronize classes and entities
- By select Synchronize members checbox, the documentation of the class attribute and entity column will also being synchronized.
Check "Synchronize members" checkbox
- Uncheck the Hide equals checkbox and all the classes/entity will be listed, even their documentation are same.