Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

When to declare mapping resources in hibernate configuration files

 
Tapan Maru
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Sumeet H Singh
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ??
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic