This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes Hiberante: Annotations Vs HBM Vs XML Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Hiberante: Annotations Vs HBM Vs XML" Watch "Hiberante: Annotations Vs HBM Vs XML" New topic
Author

Hiberante: Annotations Vs HBM Vs XML

Shiaber Shaam
Ranch Hand

Joined: Jun 16, 2006
Posts: 252
Is it a matter of convenience to choose between Annotations or HBM or XML. Please clarify when to choose what? Appreciate your time.


$Hi/\bEr
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

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.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Shiaber Shaam
Ranch Hand

Joined: Jun 16, 2006
Posts: 252
Thanks, But, what about HBM files? when do we choose to use it?
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

XML is good because your simple Java objects are not cluttered with ORM specific annotations
Michael Houlo
Ranch Hand

Joined: Jun 07, 2010
Posts: 58
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...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Hiberante: Annotations Vs HBM Vs XML
 
Similar Threads
ejb 3.0 vs spring
Annotations vs XML
moving to hibernate annotations
Annotations vs XML
struts2 Vs spring mvc