-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Reverse-engineering - generating multiple hibernate.cfg.xml
PostPosted: Fri Jan 27, 2006 10:36 am 
Beginner
Beginner

Joined: Tue Jan 24, 2006 1:48 pm
Posts: 20
Location: Stevenage, UK
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.