Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how many entities?

 
Guy Emerson
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 661
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Guy Emerson
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic