I just accidentally stumbled upon this problem, and I think I found the perfect tool for this job.
http://hibernatepojoge.sourceforge.net/
Features: (in case you are too lazy to go through the provided link)
- Java objects representing each table, using annotations for use with Hibernate.
- An example JUnit test for a table that uses objects created to create, populate, save, retrieve, and compare results.
- DAO for each class
- Matching Enumeration Files
- Spring and sleep
- DAO Levels
- The factory class for each scheme for returning a pre-populated object with random data (for checking boundaries, a set of databases, etc.)
Also supports:
- A join of tables, including those with additional fields in link tables
- Polymorphism / inheritance support
- Composite Keys
- one-to-one, many-to-one, many-to-many, etc.
- Support for multiple circuits (4 modes)
- Natural keys
- Enumerations (including those entries that cannot be correctly displayed in the java world)
- A whole bunch more stuff (see sample.xml)
I would also like to say that setting this up is pretty straight forward; You just need to have the hibernate configuration file and the jar file downloaded from the site. Then it's just a question executing the jar file, passing config.xml as a parameter!
source share