• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

difference between JPA and Hibernate?

 
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

 
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Both are two different technologies that follow ORM specfications .

 
Rancher
Posts: 1337
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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).
 
author & internet detective
Posts: 42135
937
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Bartender
Posts: 4568
9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic