Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

difference between JPA and Hibernate?

 
Satyajeet Kadam
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Q1) Kindly let me know the difference between JPA and Hibernate?

As i as i know JPA is a specification from Sun Microsystem.Hibernate and Top link also providing the implementation of it.This has been done to avoid vendor Locking.

 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Both are two different technologies that follow ORM specfications .

 
Lester Burnham
Rancher
Posts: 1337
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As i as i know JPA is a specification from Sun Microsystem. Hibernate and Top link also providing the implementation of it.

That's correct (except the spec is from the JCP, but that's quibbling over minor differences). Other JPA implementations also exist, like OpenJPA.

Both are two different technologies that follow ORM specfications.

This is not correct: JPA is the specification, Hibernate/TopLink are the implementations.

It should be noted that some implementations (Hibernate, specifically) also have their own API which is different from JPA. Using that would lead to difficulties when considering a switch to a different implementation (the vendor lock-in mentioned above).
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34423
347
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hibernate provides 2 APIs - one is JPA. So you can use Hibernate's implementation of JPA without vendor lock in if you use those APIs.
 
Matthew Brown
Bartender
Posts: 4567
8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jeanne Boyarsky wrote:Hibernate provides 2 APIs - one is JPA. So you can use Hibernate's implementation of JPA without vendor lock in if you use those APIs.

Is there an advantage to using the non-JPA Hibernate API? Or is it just there for historical reasons?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic