HiberObjects

Download

Order

Forum

Vote for this plugin

Modify the Design with Groovy Scripts

The designed classes can be modified from Groovy scripts. Here is an example of how to generate a version attribute with a @Version tag in all <<Persistent>> classes:

When the diagram is saved, this will generate Java code:
@javax.persistence.Version public int getVersion() { return this.version; }

To modify classes of a specific stereotype, download the corresponding file, copy it into your project root directory and modify it as desired:

Stereotype Groovy Script
DAO DAOClassBuilder.groovy
Java Bean JavaBeanClassBuilder.groovy
Persistent PersistentClassBuilder.groovy
Persistent Test PersistentTestClassBuilder.groovy
Unit Test UnitTestClassBuilder.groovy
GWT Service GWTServiceClassBuilder.groovy

When you update the script, you can see the changes immediately in the class diagram. Then, save the diagram to regenerate the Java code.

The script has a two methods build and clear that are called as follows: