Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate annotations and JPA

 
rani vini
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is hibernate annotations and what is JPA.
I am thinking hibernate annotations are nothing but implementation of JPA. Is that correct?
Can any one explain this in detail?
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ran vi wrote:What is hibernate annotations and what is JPA.
I am thinking hibernate annotations are nothing but implementation of JPA. Is that correct?
Can any one explain this in detail?


JPA is a specification. In the specification it does talk about the JPA Annotations. Hibernate implements those Annotations and it also includes Hibernate only annotations that the JPA spec doesn't cover. Like delete orphan cascade option. There is no such option in the JPA spec about delete orphans. But you do have a delete orphan cascade option in Hibermate, although that is kind of a bad example because it is an attribute of an Annotation rather than an Annotation itself.

But just know that Hibernate has some annotations that go beyond those from the JPA spec.

Mark
 
Lalit Bhatt
Ranch Hand
Posts: 69
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JPA is a specification and Hibernate is an implementation of that specification. There are some vendor specific annotation as happens everywhere when the standards are implemented. you can check the tutorial on implmenting JPA using Hiberenate
 
rani vini
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JPA is just specification/Standard and there is no implementation in that.
Frameworks like hibernate and Topilink will implement those specification (What ever mentioned in JPA).Without those frameworks like hibernate OR toplink we can't use JPA.
Is my understanding correct?
 
Lalit Bhatt
Ranch Hand
Posts: 69
Java
 
rani vini
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanq All
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic