• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Why do we use Hibernate annotations?

 
Kamila Rutkowski
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why is it important? what are the advantages compared with XML mapping? Could anyone please explain these completely for me?
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35279
384
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kamila,
Annotations are less verbose. They also define the mapping right where the fields are defined.

If your database changes independently of the code, annotations would not be the right choice. For many applications, the database is stable and annotation make development easier.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic