views:

91

answers:

3

Hi,

I have just joined a on going project based on spring framework. It usage hibernate as ORM system. and it is well integrated. I have learned a lot with this project. But some how i am not satisfied with my understanding of hibernate, JPA, when they are mixed together. It has been very confusing for me to understand when my PM is talking about a term in hibernate perspective and when he have moved to JPA.

So, Please give me some insight about these terms.. How they are integrated? How they are separate form each other? In Context of spring-hibernate: what does it mean to have hibernate template?

There are a lot of questions here; I think, I am not able to put my question precisely; But I am very very confused with the whole state of terms.... :(

Reagard; Vijay Shanker

+2  A: 

JPA is a specification. Hibernate is one product that implements the JPA specification (and so is EclipseLink, for example).

The book "Pro JPA 2" is a great resource for learning the details about JPA.

ORM (Object-Relational Mapping) is the concept of translating between the "object" model used by an object-oriented language like Java, and the "relational" model used by a relational database like Oracle or MySQL. JPA and Hibernate are both tools that enable ORM so you don't have to code the whole solution yourself.

Jim Tough
A: 

Maybe a duplicate of Differences between hibernate and others

Very short and excellent answer by Toolkit in Hibernate vs JPA may also help.

Nils Schmidt
A: 

JPA is a specification, with a provider that actually implements the ORM functionality. There are several providers available - the reference implementations (Toplink Essentials and EclipseLink for JPA 1.0 and JPA 2.0), Hibernate, OpenJPA etc.

When you're moving from Hibernate to JPA it helps to understand the mapping between the various Hibernate concepts/classes with the JPA concepts/classes. After all, Gavin King is one of the members of the expert group for the JPA spec. One of the points missing in the mapping is the concept of a persistence context, which is explained pretty well in the OpenEJB JPA 101 notes.

Vineet Reynolds