File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Object Relational Mapping and the fly likes Can we have 2 hibernate.cfg.xml? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Can we have 2 hibernate.cfg.xml?" Watch "Can we have 2 hibernate.cfg.xml?" New topic
Author

Can we have 2 hibernate.cfg.xml?

Tapan Maru
Ranch Hand

Joined: May 08, 2006
Posts: 65
Hi All,

Can we have 2 hibernate.cfg.xml files in class path? If yes, how hibernate will pickup the one? or will it pickup both the files?

Thanks in Advance...


Tapan Maru
tapanmaru@gmail.com
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41599
    
  55
What are you trying to achieve? What's wrong with using a single file?


Ping & DNS - my free Android networking tools app
Sunny Bhandari
Ranch Hand

Joined: Dec 06, 2010
Posts: 448

yes you can have multiple config files (as with struts)

in case of collision, the later mapping will override the first one...


Java Experience
 
wood burning stoves
 
subject: Can we have 2 hibernate.cfg.xml?