• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Hibernate vs JPA?

 
Ranch Hand
Posts: 42
Android Google Web Toolkit Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

Can someone please explain to me what the main differences are between JPA and Hibernate? (except for JPA being part of Java EE itself)

I have a feeling that JPA is a more basic version Hibernate, so please correct me if I'm wrong.

And does it make sense to use the JPA in Hibernate itself?

Thanks in advance for the possible replies!
 
author and cow tipper
Posts: 5009
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
JPA is really a specification. It does nothing without an implementation.

It's like architectural drawings for a house. I mean, you can't live in a house until someone builds one. Drawings are great, but you can't live in them.

Hibernate provides an implementation of the JPA specification. Vendors providing EJB3.0 containers will also be providing an implementation of the JPA spec, so that means Sun and IBM WebSphere and Oracle and all the other handsome players in the industry will provide an implementation. Those are the houses you can live in.

Hibernate is awesome, and it was awesome before the JPA spec came out, and it is even more awesome since it has been providing an implementaion of the JPA spec.

-Cameron McKenzie
 
Jochen Szostek
Ranch Hand
Posts: 42
Android Google Web Toolkit Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Cameron Wallace McKenzie:
JPA is really a specification. It does nothing without an implementation.

It's like architectural drawings for a house. I mean, you can't live in a house until someone builds one. Drawings are great, but you can't live in them.

Hibernate provides an implementation of the JPA specification. Vendors providing EJB3.0 containers will also be providing an implementation of the JPA spec, so that means Sun and IBM WebSphere and Oracle and all the other handsome players in the industry will provide an implementation. Those are the houses you can live in.

Hibernate is awesome, and it was awesome before the JPA spec came out, and it is even more awesome since it has been providing an implementaion of the JPA spec.

-Cameron McKenzie



Aha! Thanks a lot!

So if I get it right, it can be compared somehow to an interface, allowing you to easily switch between different implementations in a project?

Thanks and greets,

Jochen
 
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, it's true. The JPA is an API, a standardization effort from the java community. Hibernate authors heavily contributed at the creation of JPA. Hibernate is certified compliant with the Java Persistence API (with some limitations). However I prefer using plain Hibernate even if I don't respect the compliance mainly because Hibernate is in a continuous development and always benefits from the cutting edge technologies. It's better than waiting a few years for a java community meeting that will incorporate that in the specifications
[ July 09, 2008: Message edited by: Cristian Vrabie ]
reply
    Bookmark Topic Watch Topic
  • New Topic