I've got 2 existing databases that I'm reverse-engineering.
My "source code" consists of the configuration files necessary to drive the reverse-engineering tools, plus templates etc, and some unit-tests.
From this I generate the POJO classes, the DAO xxxHome classes, the .hbm.xml files and the hibernate configuration files.
The thing is, with two databases to reverse-engineer, I need two hibernate configuration files.
Defining two of these for the reverse-engineering code to read is easy enough, and so I've got databaseOne_src_hibernate.cfg.xml and databaseTwo_src_hibernate.cfg.xml in my source directory.
However, when it comes to the reverse-engineering code generating me a hibernate configuration file, there doesn't appear to be any way of specifying the name of that hibernate configuration file.
e.g. I'd like the hibernate configuration file that was based on databaseTwo_src_hibernate.cfg.xml to be named something like databaseTwo_generated_hibernate.cfg.xml
The nearest I've found is the ability to set the "output directory", so whilst I can create two hibernate configuration files, I can only do so by having two output directories each containing a file named hibernate.cfg.xml, which then means I have to be careful how I build my project to allow all the Java code to merge nicely into one sensible package structure whilst keeping the two hibernate.cfg.files distinct.
Is there a better way of doing this, or is this a candidate for a JIRA enhancement request?
Hibernate tools version: TOOLS_3_1_0_BETA3
|