aspose file tools
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 Badass: Making Users Awesome this week in the Game Development forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Where to put *.hbm.xml file" Watch "Where to put *.hbm.xml file" New topic

Where to put *.hbm.xml file

ram gaurav
Ranch Hand

Joined: Mar 29, 2006
Posts: 208

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

Please tell the necessary work for that.

Paul Sturrock

Joined: Apr 14, 2004
Posts: 10336

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

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Mark Spritzler

Joined: Feb 05, 2001
Posts: 17260

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.


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
I agree. Here's the link:
subject: Where to put *.hbm.xml file