wood burning stoves 2.0*
The moose likes Object Relational Mapping and the fly likes What's the difference between Hibernate and JPA? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "What Watch "What New topic
Author

What's the difference between Hibernate and JPA?

Matthew Vahedi
Greenhorn

Joined: Jan 05, 2012
Posts: 16
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

Joined: Jul 20, 2005
Posts: 9913
    
158

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.

[My Blog] [JavaRanch Journal]
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41046
    
  43
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 :-)


Ping & DNS - my free Android networking tools app
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: What's the difference between Hibernate and JPA?
 
Similar Threads
What to learn after basics of servlets and JSP?
Comparing Persistence Frameworks
@JoinColumn Question
How to persist an Object
Hibernate suppourt with JPA