Search code examples
hibernatejpaopenjpa

Why comparisons are made between JPA, Hibernate etc


Although not a novice, I am still on the learning curve of JPA. As I understand, JPA is just a specification, for which there are many implementers for example: Hibernate, OpenJPA etc.

Now, I have seen many posts which ask question: "JPA VS Hibernate", "To use Hibernate or JPA" etc.

My doubt is:

1) If Hibernate is an implementation of JPA, then why are comparisons made "JPA vs Hibernate" etc. JPA is just specification (if my understanding is correct), then what sense these comparisons make OR may be I haven't fully understood this.

Any help to clear this doubt greatly appreciated.


Solution

  • Hibernate is not only a JPA implementation, but offers its own API: http://hibernate.org/orm/. Most comparisons are between the Hibernate native API and JPA API.

    When using the native API there are some advanced features, but you are bound to Hibernate and you cannot switch the implementation easily like for JPA if you want to use EclipseLink instead for example.