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 description between classes and entities.

October 30, 2009
User Rating: / 43
Views: 107,631
PDF Link Add comments
Edition: Modeler or above (Edition comparison)

To generate class diagrams from entity relationship diagrams:

  1. We first open Project Browser by selecting View > Project Browser from the toolbar.
    open project browser
  2. Click the New Model button to create a new model.
    new model
  3. Enter the name as Entity Model.
    input eame in model specification
  4. Now, let's create entity relationship diagram under Entity Model. Right click on the Entity Model and select Sub Diagrams > New Diagram....
    create diagram
  5. In the New Diagram popup window, select Database Modeling > Entity Relationship Diagram. Click Ok to confirm.
    create entity relationship diagram
  6. Develop the following entity relationship diagram.
    device support history er diagram
  7. Repeat the above steps to create the following entity relationship diagram under Entity Model.
    device puurchase er diagram
  8. Once the entity relationship diagrams are ready, we can then generate class diagrams from our entity relationship model. Select Tools > Hibernate > Synchronize to Class Diagram from the toolbar.
    synchronize to class diagram
  9. The Synchronize form Entity Relationship Diagram to Class Diagram dialog will be shown. The entity relationship diagrams in your project show 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
  10. Click on the entity relationship diagram cell and the preview will be shown up.
    preview erd diagram
  11. 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
  12. Press OK to proceed.
  13. 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
  14. We can specify the target for storing the output class diagram. Select Specify... in the Target Parent combo box.
    selecting target model
  15. Select the root node in the tree and press the New Model button. Name the model as Class Model.
    create class model
  16. Press OK to proceed.
  17. Now the class diagrams are being generated.
    generated uml class diagrams
  18. Let's try to modify the description of the class PriorityType.
    modigy priority type class description
  19. You can synchronize the description from class model to the associated entity model by right click on the diagram and select Utilities > Synchronize Class Description to ERD.
    synchronize class documentation to ER diagram
  20. Class Description to ERD dialog will list class models which contain different descriptions with the entity model.
  21. Click on the entity PriorityType in the list and the differences of descriptions between class and entity model will be shown.
    synchronize class documentation dialog box
  22. Select the checkbox under Synchronize column to specify the model you would like to synchronize their descriptions.
    check synchronize classes and entities
  23. By selecting Synchronize members checkbox, the descriptions of the class attribute and entity column will also being synchronized.
    check synchronize member checkbox
  24. Uncheck the Hide equals checkbox and all the classes/entity will be listed, even their descriptions are the 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. Draw Entity Relationship Diagram (ERD)
    Tagged:
  4. Perform UML Modeling in NetBeans
  5. How to Organize Diagrams with Package?
    Tagged:
Tags of this article:

Comments (14)

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"?

written by Ferraz on June 25, 2015

You should put this last issue public because I have the same problem. Can't synchronize ORM persistable classes ant association to ERD. Nothing happens.

written by Jick Yeung (VP) on June 25, 2015

Hi Ferraz,

Could you send us your project for reproduce the problem and for diagnosis? Please send by submitting a ticket at:
http://www.visual-paradigm.com/support/

Thank you.

Write comment

Rating

Comment

Enter the calculation result

security code