Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

how many entities?

 
Ranch Hand
Posts: 42
  • 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 .
 
Ranch Hand
Posts: 662
Eclipse IDE Spring Java
  • 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: 42
  • 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
 
Die Fledermaus does not fear such a tiny ad:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
    Bookmark Topic Watch Topic
  • New Topic