• 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:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Hibernate mapping - naming convention  RSS feed

 
Ranch Hand
Posts: 300
  • Mark post as helpful
  • send pies
  • 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
  • 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.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!