Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hiberante: Annotations Vs HBM Vs XML

 
Shiaber Shaam
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it a matter of convenience to choose between Annotations or HBM or XML. Please clarify when to choose what? Appreciate your time.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Largely personal choice really. Annotations are good because your configuration is all in one place and they follow the JPA standard. XML is good because your simple Java objects are not cluttered with ORM specific annotations. Both support he same functionality.
 
Shiaber Shaam
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, But, what about HBM files? when do we choose to use it?
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
XML is good because your simple Java objects are not cluttered with ORM specific annotations
 
Michael Houlo
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Shiaber Shaam wrote:Thanks, But, what about HBM files? when do we choose to use it?


Thing is : hbm files are just xml files with just a .hbm extension to highlight the fact that your xml file is an hibernate configuration file...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic