aspose file tools*
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 Java 8 in Action this week in the Java 8 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: 9342
    
111

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: 39575
    
  27
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 - updated with new look and Ping home screen widget
 
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?
How to persist an Object
Hibernate suppourt with JPA
@JoinColumn Question
Comparing Persistence Frameworks