Hibernate or JPA?

A

andreic

Hi,

I am working on a project that involves the use of a database. I would
like to use ORM and my initial thought was to use Hibernate. Meanwhile
I started looking at EJB3 and notices the Java Persistence API... I
don't have much experience with Hibernate, and also didn't use the JPA
before... I would like to get some oppinions on which one is better
and why from people who have used Hibernate and/or JPA before.

Thank you in advance!

Andrei
 
D

Daniel Dyer

Hi,

I am working on a project that involves the use of a database. I would
like to use ORM and my initial thought was to use Hibernate. Meanwhile
I started looking at EJB3 and notices the Java Persistence API... I
don't have much experience with Hibernate, and also didn't use the JPA
before... I would like to get some oppinions on which one is better
and why from people who have used Hibernate and/or JPA before.

Hibernate *is* an implementation of the JPA specification. However, it
also pre-dates JPA, so there are other ways in which you can use it.
OpenJPA (http://openjpa.apache.org/) is an alternative JPA
implementation. Both have their quirks and bugs. I have mostly used
Hibernate, but decided to go with OpenJPA on my most recent project.
Hibernate's dependencies are a bit of mess - there are 3 separate
downloads required to use JPA and you have to consult the matrix to
determine which versions of each can be used together. OpenJPA is more
focused since it doesn't support non-JPA modes of working (there is only
one download and fewer library dependencies).

Dan.
 
R

Robert Klemme

Hibernate *is* an implementation of the JPA specification. However, it
also pre-dates JPA, so there are other ways in which you can use it.
OpenJPA (http://openjpa.apache.org/) is an alternative JPA
implementation. Both have their quirks and bugs. I have mostly used
Hibernate, but decided to go with OpenJPA on my most recent project.
Hibernate's dependencies are a bit of mess - there are 3 separate
downloads required to use JPA and you have to consult the matrix to
determine which versions of each can be used together. OpenJPA is more
focused since it doesn't support non-JPA modes of working (there is only
one download and fewer library dependencies).

OTOH, if you use Hibernate's JPA implementation as part of a JEE
container (e.g. JBoss) you usually do not need to worry about those
issues because JBoss team has taken care of this already.

Kind regards

robert
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,073
Latest member
DarinCeden

Latest Threads

Top