UML2 to JEE : Struts/Spring/Hibernate

UML2 to JEE generates Java/JEE code and files from a stereotyped UML2 model. The generated software has a layered architecture:

  • User Interface
  • Data Transfert Objects
  • Data Access Layer


L'Acceleo JEE Sprint 2008 is coming ! more information on the dedicated page !


The next showcase describe the use of the JEE module and Topcased to generate a JEE data access layer

Complete documentation can be found on the Acceleo's wiki. Consult it first if you encounter problems. Don't hesitate to contribute !!

Technical target overview


Struts is an Apache framework allowing a real distinction between the user interface and the business logic of a JEE software. It's known as the Model-View-Controller pattern (MVC). Struts is broadly used but appears to be quite difficult to setup, and keeping consistency between screens and actions through the XML files quickly become a challenge.

Struts may be used with Ajax in order to provide Web 2.0 applications

Struts is available at the following url :


Hibernate is a JEE framework handling the Object/Relational mapping. Using Hibernate one may persists Object data in a relational database.

Hibernate is available at:


The generator produce code from UML2.1 models enhanced with a few stereotypes.

You may use different modelers with this generator : Topcased, Papyrus or the UML2 Tools Eclipse project.


The generator use Hibernate best practives in order to provide a better productivity and great performances.
About persistency:

Easy browsing on business objects

  • subclassing
  • 1-1, 1-*, *-* associations
  • unidirectional and bidirectional navigability
  • optimisations
  • Use of POJOs

Relational Mapping

  • Cache handling on persisted data
  • 3NF SQL
  • integrity constraints
  • concurrence accesses
  • technical id

Data Access Layer

  • no dependency between DTOs and Hibernate
  • advanced search methods
  • transaction handling
  • JUnit tests

About the application cinematic:

MVC2 Architecture

  • Struts forms and actions
  • navigation between screens
  • consistency between Java, XML files and specifications

Externalized navigation

  • screen transitions locking
  • Struts actions and forms settings
  • Tiles templates
  • Slicing in functionnal scenarios
  • Tomcat settings
  • Forms validation

Pages template handling

  • web files (jsp, css 2)
  • use of standards taglibs
  • functionnal tests (HTMLUnit)
  • quick prototyping
  • event-based AJAX


Module status
Business objects


Data Access layer


Hibernate mapping


MVC Architecture




Pages templates


Forms enhancements





The installation process is described on the installing a module web page. .


If you want to change or complete the generative templates you may use the a Team Project Set file. Using this file you'll be able to import the module sources right from the Subversion repository inside your Eclipse.

Team Project Set file for JEE module

The getting and modifying generator module sources page explains how to use this file.