It's not a secret anymore!
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
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

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
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42958
What are you trying to achieve? What's wrong with using a single file?
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
Have you checked out Aspose?
subject: Can we have 2 hibernate.cfg.xml?
jQuery in Action, 3rd edition