views:

348

answers:

2

As far as I know, JPA itself offers all the shiny features like ORM, JPQL, entity relations mapping and so on. But I don't really understand, why do people use Hibernate or Toplink on top of JPA.

What does Hibernate offer that JPA itself doesn't have?

+3  A: 

JPA is just a specification. Hibernate and TopLink are implementations of that specification.

Also, the JPA spec is a bit weak, it provides only a subset of the functions that the likes of Hibernate and TopLink provide. Sometimes it is desirable or necessary to go beyond JPA and use the proprietary features of the underlying implementation.

skaffman
+1  A: 

You should make your comparison against JPA1, and then against JPA2 (not yet final, but there is a spec), and look at the features you want in your application to see if any are not supported by JPA. This is the only sensible way of assessing whether you can use pure JPA. All implementations of persistence technology have their own add ons that may make a whole lot of sense to your application, but they may not too. Assess your application for the types of relations you have between objects. To get you started, do you use fields that are interfaces ? JPA has no support for interface-defined relations. JPA1 has no support for 1-N uni dir FK relations, but this is in JPA2.

--Andy (DataNucleus)

DataNucleus
i am researching the same. can you please provide (or atleast point me to the online docs) on the below two things you have mentioned for JAP1 1)interface-defined relations and 2) no support for 1-N uni dir FK relations
Pangea
Reading the JPA spec(s) would confirm what I put.
DataNucleus