• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Hibernate mapping - naming convention

 
Ranch Hand
Posts: 300
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I am suspicious about few point in hibernate -

1) What should be the name of mapping file . It should be same as of class mentioned.


For example here class name is Event then mapping file name should be Event.hbm.xml. Is it mandatory.

2) We have two option to manage mapping files - 1) It could be file per class 2) multiple classes in one file.

In the case of multiple classes is there any naming must that we need to follow or in a simple language what would be the name of file in case of multiple classes in one file.

Thanks in advance !!!

Regards,
Patricia Samuel.
 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm suposing that you are asking rather than stating (despite you don't write it this way ;) ).

1st) The name of configuration file can be what you wanna it be. Once you'll declare it in the configuration model (i.e. hibernate.cfg.xml). But it's a convension to use NameOfBean.hbm.xml.

2nd) You can have as many configurations as you need to a single Bean. Despite I never had seen a true need for this in real (large) projects. Just be careful to duplicate Entities in you configuration model.

I hope be useful.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic