Generate Class Diagram from Entity Relationship Diagram (ERD)

Visual Paradigm supports generating class diagrams from ER diagrams (entity relationship diagram). Entities and relationships are mapped with classes and associations accordingly. This tutorial teaches generating class diagrams from entity relationships diagrams and how to synchronize documentation between classes and entities.

October 30, 2009
User Rating: / 37
Views: 86,978
PDF Link Add comments
Edition: Modeler or above (Edition comparison)

To generate class diagrams from entity relationship diagrams:
  1. 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

    Create entity model in Model Explorer

  2. Enter the name as Entity Model.
    Input 'Entity Model' in model specification dialog box

    Input "Entity Model" in model specification dialog box

  3. 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'

    Create entity relationship diagram under "Entity Model"

  4. Develop the following entity relationship diagram.
    Device support history ER diagram

    Device support history ER diagram

  5. Repeat the above steps to create the following entity relationship diagram under Entity Model.
    Device purchase ER diagram

    Device purchase ER diagram

  6. 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

    Select "Synchronize to Class Diagram" menu item

  7. 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

    ER diagram to UML class diagram mapping dialog box

  8. Click on the entity relationship diagram cell and the preview will be show up.
    Preview ERD diagram

    Preview ERD diagram

  9. 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

    Assign meaningful name to UML class diagram

  10. Press OK to proceed.
  11. 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

    Entity column to class attribute mapping table

  12. We can specify the target for storing the output class diagram. Select Specify... in the Target Parent combo box.
    Selecting target model

    Selecting target model

  13. Select the root node in the tree and press the New Model button. Name the model as Class Model.
    Create 'Class Model'

    Create "Class Model"

  14. Press OK to proceed.
  15. Now the class diagrams being generated.
    Generated UML class diagrams

    Generated UML class diagrams

  16. Let's try to modify the documentation of the class PriorityType.
    Modify 'Priority Type' class's documentation

    Modify "Priority Type" class's documentation

  17. 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 ER Diagram

  18. Synchronize Class Documentation to ERD dialog will list class model which contain different documentation with the entity model.
  19. 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

    Synchronize class documentation dialog box

  20. Select the checkbox under Synchronize column to specify the model you would like to synchronize their documentation.
    Check synchronize classes and entities

    Check synchronize classes and entities

  21. By select Synchronize members checbox, the documentation of the class attribute and entity column will also being synchronized.
    Check 'Synchronize members' checkbox

    Check "Synchronize members" checkbox

  22. Uncheck the Hide equals checkbox and all the classes/entity will be listed, even their documentation are same.

Rate this Article

Click on one of the stars below to rate this article from 1 (lowest) to 5 (highest).

You may be interested in

  1. Data Flow Diagram (DFD) Tutorial
  2. Writing Effective Use Case
  3. Share Design, Discuss Design with PostMania
    Tagged:
  4. Draw Entity Relationship Diagram (ERD)
    Tagged:
  5. How to Organize Diagrams with Package?
    Tagged:
Tags of this article:

Comments (12)

written by Manish on January 19, 2010

Thank you for this much of information this is very helpful for me.



thank you once again.....



Manish

written by bimo on February 19, 2010

I cant finde this sync on my workspace.
I'm using VP 7.0

thanks

written by Angus Chan on February 19, 2010

1. Which Edition you are using?
2. Sync to different diagram selection available from 7.1 or later.

written by Gianluigi on February 24, 2010

hello,
I'm trying the community edition and thinking to buy a different version betwen modeler and standard. what's the lower release with this feature and the creation of SQL (for mySql) from ER Diagram?
thanks for information.

Gianluigi

written by jick on February 25, 2010

Hi Gianluigi,

The Professional Edition is the minimum edition that supports this feature and other ORM features like database/orm code generation, and the reversal of database.

If you are looking for database and class engineering, you may consider another product of us, called DB Visual ARCHITECT. The Professional Edition of DB Visual ARCHITECT supports class and entity relationship modeling, and database engineering, and is a more cost effective solution comparing to VP-UML, provided that you only need class and database modeling and engineering features.

For details about DB Visual ARCHITECT, please read:
http://www.visual-paradigm.com/product/dbva/

Best regards,
Jick

written by David Lowe on May 4, 2011

is it possible to create the ERD from a class diagram or is it only from possible to create the class Diagram from the ERD?

written by Angus Chan on May 5, 2011

Yes, you can. Please watch following video
http://www.youtube.com/user/VisualParadigm#p/u/0/fJA2cJziYhM

written by Marco on February 21, 2013

is this feature available on evaluation copy for enterprise edition?

The tool menu doesn't show the "ORM" option sub menu.

I'm ussing version 10.1 build 20130203
in windows xp sp3 with java jre 1.6.35

Thanks in advance.

written by Jick Yeung (VP) on February 21, 2013

Hi Marco,

VP-UML has undergone many changes since the time this tutorial was written. Therefore, the instruction is a bit outdated. We are sorry about this.

To access the ORM features, please go through this menu: "Tools > Hibernate" instead.

Best regards,
Jick Yeung

written by sooyoung on July 8, 2014

hi I tried to create the ERD from a class diagram but I couldn't do and I got the message "you have no write permission on C://Program Files|Visual Paradigm 11.1"
the reason why I can't do is trial version?

written by Angus Chan on July 8, 2014

The trial should not have this problem. Can you contact our support team by support@visual-paradigm.com to check your issue?

written by sooyoung on July 8, 2014

i can make class-diagram from erd but i can't create erd from class-diagram. if i click " Synchronize Class Documentation to ERD", nothing is happening. how can i contact your support team? am i email to "support@visual-paradigm.com"?

Write comment

Rating

Comment

Enter the calculation result

security code