I'm hereby announcing the immediate availability of "Hibernate Pojo Generator", a source code generator tool. This is similar to Joe Hudson's "Hibernate synchronizer" except:
- It generates code with hibernate annotations instead of .hbm.xml files
- It supports multiple schemas, enumerations, natural keys, composite keys, join tables, etc
- It creates a JUnit test case for each table
- It creates code for use directly with Spring
This is not (yet) an eclipse plugin since we're currently using it in an automated fashion, i.e., change the db, automatically create jar files of the data layers. If enough interest is elicited, I'll create an eclipse plugin version too.
A lot of work has been done to minimise any effort on the user's part, such as:
- Generated code usually contains no warnings, it's javadoc'd etc
- All the configs are in place (hibernate.xml.cfg, applicationContext.xml), 3rd party jars
- Test cases are written for you including helper classes to pre-populate any table object with random data respecting the underlying types.
- The generator is able to handle pretty complex schemas (compound foreign natural keys anyone?)
Usually, just pointing it a DB results in code ready to be dropped in your application.
At the moment it's been heavily tested on MySQL only (postgres might work too). We'll be working as fast as we can to make sure support is present for the other DBs.
More info is available at:
http://sourceforge.net/projects/hibernatepojoge/
Licensed under GPL. Source code will be uploaded hopefully by the time you read this message.
Feedback is appreciated.
P.S. Admins is this the right place for this message or should this go in "Hibernate Tools" instead?