5

I want to design my UML diagrams in a program, and have the program generate Java classes and Hibernate mappings.

Java to UML generator on Linux is similar but does not fulfill all my requirements.

Required features:

  1. Essentially drawing a class diagram and the program should generate the classes in Java.
  2. Support UML 1.x or 2.x
  3. The program must generate *.java files that work in Java 1.5.
  4. The program generate *.hbm.xml files that work in Hibernate 4.
  5. Must run in Windows or Linux (both is a plus).

Optional features:

  1. Can export in other languages (like C# for example).

I tested modelio but it is not for me.

  • 1
    If you have a lot of money - you could look at IBM Rational Software Architect with it's vast modelling and codegeneration abilities. – Konstantin V. Salikhov May 1 '14 at 16:15
  • Eclipse has a UML plugin/extension that will generate code from your diagram – ivanivan Jun 24 '18 at 15:11
2

I suggest to use StarUML.

StarUML is an open source project to develop fast, flexible, extensible, featureful, and freely-available UML/MDA platform running on Win32 platform (from: old project of StarUML, this project has been discontinued). Although that project has been discontinued, StarUML starts a new project (since long time no updates) with StarUML 2.

The newer version of StarUML almost fulfills your requirements below:

  • You can draw a class diagram and generate the classes in Java using extension.
  • Compatible with UML 2.x standard and supports totally 11 kinds of UML diagrams. So, it must be different with UML 1.x.
  • The program can generate classes in *.java, but it based on Java 1.7 specification
  • The program can't generate *.hbm.xml.
  • Running on Windows and Linux, even Mac OS X.
  • (optional) you can generate source code not only for Java but also C# / C++.

My answer can't fulfill your requirements. At least, it almost fulfills your needs. I hope my suggestion will help you.

0

There is a new, advanced Java code generator for StarUML, that also supports Hibernate (annotations), as well as Spring to a certain extent. For more information, you can visit https://www.archetypesoftware.com/.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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