This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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 Murach's Java Servlets and JSP this week in the Servlets 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: 41029
    
  43
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
 
 
subject: Can we have 2 hibernate.cfg.xml?
 
Similar Threads
hibernate.cfg.xml required in version 2.x?
are these 2 same or not
When to declare mapping resources in hibernate configuration files
fruit problem
Can we create a sessionFactory from a combination of Annotated Classes and Hbm files.