Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What's the difference between Hibernate and JPA?

 
Matthew Vahedi
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm confused! somewhere I read that JPA is part of EJB 3.0 specification and Hibernate implements JPA, then in other places people talk about whether to choose JPA or Hibernate!
Can someone please shed light on these definitions?

Thanks in advance.

Cheers,
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hibernate is an implementation of the JPA spec. Hibernate (and even other implementations) in addition, also provide implementation specific features.

When people say whether to use Hibernate or JPA, I think they mean whether to use implementation specific features or whether to just stick with the portable JPA API features.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JPA is an API, while Hibernate is an implementation of JPA. Other implementations (like OpenJPA and EclipseLink) exist as well. The benefit of using the JPA API is that you can choose between these different implementations.

What people mean by "Hibernate vs. JPA" is that Hibernate also implements its own API, which is separate from JPA. It can do some things that JPA can't, but using it ties you to Hibernate.

Edit: ... what he said :-)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic