2009年5月15日 星期五

Difference between JPA and hibernate

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

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 ]

Source
http://www.coderanch.com/t/218819/Object-Relational-Mapping/java/Hibernate-vs-JPA