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 When to declare mapping resources in hibernate configuration files 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 "When to declare mapping resources in hibernate configuration files" Watch "When to declare mapping resources in hibernate configuration files" New topic
Author

When to declare mapping resources in hibernate configuration files

Tapan Maru
Ranch Hand

Joined: May 08, 2006
Posts: 65
Hi,

I am using hibernate at DAO layer with spring MVC in my application. As per my understandings we have to declare mapping resources (hibernate mapping files) in hibernate configuration file. What if my application needs addition of tables in future? Does it mean that I will have to add mapping resources in hibernate configuration file and redeploy the project again?

Is there any alternative solution so that I can avoid redeployment of the project?

Thanks in Advance..

Tapan Maru
tapanmaru@gmail.com


Tapan Maru
tapanmaru@gmail.com
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Yes, you will - if your application is going to use those tables. But this is a situation that would exist regardless of whether you are using Hibernate. If you have new tables you want your application to use you are going to have to do something to use them.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Sumeet H Singh
Greenhorn

Joined: Jan 03, 2009
Posts: 29
Hi,
I have a doubt related to Tapan's doubt..
For including multiple mapping files, we can package our hbm.xml files inside a jar file and make hibernate load them by using the addJar(File jarFile) method of the Coniguration class...

But is there any way that I can declaratively do this in hibernate.cfg.xml ??


Sumeet
SCJP, SCWCD
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: When to declare mapping resources in hibernate configuration files
 
Similar Threads
hibernate hello world
Hibernate + Configuration.addClass Exception
Can't find mapping file
Usage of maven
Spring and Hibernate ... i am confuse