• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

difference between jpa Annotations and Hibernate Annotations

 
mano ranjan
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
Can anybody explain me what is the difference between JPA Annotations and Hibernate Annotations and which one is better to use...

thanks
mano.
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One costs absolutely $0 and the other is free.

One is a Specification and one has annotations beyond JPA.

Basically Hibernate implements the JPA spec and also adds more features above th spec. so the Hiberate specific Annotations are those added features. So you use JPA annotations until you come across a mapping that forces you to use Hibernate specific features, then you need to use their annotations to get those features.

Now some of those Hibernate features and well as Toplink's features that go above and beyond current JPA spec, might be included in the next version of the JPA spec in Java EE 6.

Mark
 
mano ranjan
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Thanks for your reply .As for as your reply as concerned Hibernate annotations are implemented by JPA annotations wright?,what do you mean by this line

So you use JPA annotations until you come across a mapping that forces you to use Hibernate specific features, then you need to use their annotations to get those features.

so can you tell some sample code examples for the difference between these two annotations...

thanks
mano
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hibernate implements JPA, meaning JPA is just a spec. So the spec defines the annotation that are in the JPA package, Hibernate like other ORM tools can implement those specs, and create those Annotation classes but have to keep them in the same package name. Any other Annotation class, not defined by JPA will be put into org.hibernate packages, and be specific to Hibernate alone.

Mark
 
Pallabi Paul
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can someone give me any link of JPA Annotations where annotations are discussed in brief ?

thanks in advance
 
Amit Ghorpade
Bartender
Posts: 2854
10
Fedora Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"pabc pxyz" please check your private messages for an important administrative matter. You can see them by clicking the My Private Messages link above.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic