Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

How can I generate a class diagram from an SQL database or script? I'll add the functions and set whether the attributes are public, private or virtual once the initial diagram is generated.

I've generated it using PowerDesigner, here is the .sql file: http://pastebin.com/S14JWjKF

share|improve this question
    
Have you already generated UML using PowerDesigner? Or used PowerDesigner to generate the SQL script? Not clear what you're asking Surely you can generate UML from PowerDesigner because your conceptial model is in PowerDesigner, not SQL. Like I'd use ORM dba.stackexchange.com/questions/1677/… –  gbn Sep 29 '11 at 15:55
    
Looks like I can build an OO model straight from the ER Diagram in PowerDesigner. This one however, doesn't have the getter and setter operations. –  A T Sep 29 '11 at 19:59
add comment

1 Answer

up vote 1 down vote accepted

Solution:

  1. Generate SQL file in PowerDesigner (or any other tool capable of generating SQL, or write it by hand)
  2. Install Eclipse with JPA and Modelling Tools
  3. Follow this guide
  4. When the guide fails you (step 4), open up another tool (or you could probably do it in Eclipse with a new project), for instance, PowerDesigner; and reverse-engineer the Java code into a Class diagram
  5. Profit!

:D

share|improve this answer
    
"3. Folow this guide"... Seems that would have an link, but there's none... –  Fabricio Araujo Oct 11 '11 at 19:41
    
Hmm, not sure what happened to the link. Anyways, here it is: forum-omondo.com/documentation_eclipseuml_2008/Eclipse_Database/…. Also of note, ObjectAID is apparently better than JPA; so try it out! –  A T Oct 12 '11 at 4:49
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.