This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes Where to put *.hbm.xml file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Where to put *.hbm.xml file" Watch "Where to put *.hbm.xml file" New topic
Author

Where to put *.hbm.xml file

ram gaurav
Ranch Hand

Joined: Mar 29, 2006
Posts: 208
Hi

I am new to Hibernate , and i want to ask that where to put *.hbm.xml file.

Please tell the necessary work for that.

Thanks
Regards
Gaurav
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Put in the classpath in the same place as your pojo class.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

Usually you will have your hibernate.cfg.xml in the root of your class path, then have your individual mappings in the same directory as your mapped objects.

Then in you hibernate.cfg.xml can point to the mapping files in a relative path that would actually match you package structure.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
Consider Paul's rocket mass heater.
 
subject: Where to put *.hbm.xml file
 
Similar Threads
need good example of hibernate with composit key
Mapping Exception
Hibernate insert fails due to generate key failure
**/* patten in Ant?
No more .hbm.xml files