This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes how many entities? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Databases » Object Relational Mapping
Reply Bookmark "how many entities?" Watch "how many entities?" New topic
Author

how many entities?

Guy Emerson
Greenhorn

Joined: Dec 14, 2010
Posts: 27
Hi brethren,
This is my introductory post here.
Could you explain how do we decide on the number of hibernate mapping files .In real-time projects do we create one .hbm.xml file or many? If we have 25 entities, do we write the mapping for all 25 classes in the same .hbm.xml file or we go for individual mapping files for each class. What is prevalent practice in the real time?

And what about the configuration file .cfg.xml. As far as I know we don't need more than one configuration file. do we?

Thanks all java enthusiasts .
Arun Kumarr
Ranch Hand

Joined: May 16, 2005
Posts: 508

Guy Emerson wrote:
If we have 25 entities, do we write the mapping for all 25 classes in the same .hbm.xml file or we go for individual mapping files for each class. What is prevalent practice in the real time?

Hi Guy Emerson, Welcome to Javaranch. The prevalent practice is to have 25 hbm files packaged in logical folders.

Guy Emerson wrote:
And what about the configuration file .cfg.xml. As far as I know we don't need more than one configuration file. do we?

We don't need. You can have one .cfg.xml file, unless you are dealing with two separate databases/schemas in your application.

If you are not laughing at yourself, then you just didn't get the joke.
Guy Emerson
Greenhorn

Joined: Dec 14, 2010
Posts: 27
Right Kumarr,
Thanks for the reply. what I was expecting has been confirmed by you. It really bothers one if he knows the answer but not sure about it. So it is great to hear from the people who are experienced like you.
Thanks again
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: how many entities?
 
Similar Threads
Working Example Needed..
How to map .hbm.xml file in persistence.xml
hbm.xml file generation in netbeans
could not read mapping from resource
No more .hbm.xml files