*
The moose likes Object Relational Mapping and the fly likes what is the best pairing with JPA? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "what is the best pairing with JPA?" Watch "what is the best pairing with JPA?" New topic
Author

what is the best pairing with JPA?

Nakataa Kokuyo
Ranch Hand

Joined: Jul 24, 2011
Posts: 184
Good day,

There is a new project and we are about to figure out what is the popular technology we should apply in persistence layer?

a bit shame as worked on JDBC thus far, and do not have much commercial experience on ORM, and I know there are common pair on JPA either with Hibernate or EJB3.

my questions are,

1. what is the best choice for ORM implementation by considering shorter learning curve, and high popularity if our system use spring MVC as backbone?

2. What is the pro and cons for JPA pairing with hibernate and EJB3?

3. Book or reference for JPA?
James Sutherland
Ranch Hand

Joined: Oct 01, 2007
Posts: 553
The three main JPA implementations are Hibernate, EclipseLink and OpenJPA.

Each application server defaults to one of the implementations:
Glassfish - EclipseLink
WebLogic - EclipseLink
WebSphere - OpenJPA
JBoss - Hibernate

For more info on JPA, see http://en.wikibooks.org/wiki/Java_Persistence


TopLink : EclipseLink : Book:Java Persistence : Blog:Java Persistence Performance
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41591
    
  55
"Best" in what respect? I've successfully used OpenJPA.


Ping & DNS - my free Android networking tools app
Nakataa Kokuyo
Ranch Hand

Joined: Jul 24, 2011
Posts: 184
Ulf Dittmer wrote:"Best" in what respect? I've successfully used OpenJPA.


Best in the sense of better performance and most robust. and if possible, shorter learning curve
Nakataa Kokuyo
Ranch Hand

Joined: Jul 24, 2011
Posts: 184
James Sutherland wrote:The three main JPA implementations are Hibernate, EclipseLink and OpenJPA.

Each application server defaults to one of the implementations:
Glassfish - EclipseLink
WebLogic - EclipseLink
WebSphere - OpenJPA
JBoss - Hibernate

For more info on JPA, see http://en.wikibooks.org/wiki/Java_Persistence


Thanks, that's a good reference site
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41591
    
  55
Nakataa Kokuyo wrote:Best in the sense of better performance and most robust. and if possible, shorter learning curve

Performance probably depends a lot on your DB, so it's not easy for someone else to make a meaningful recommendation. It's also something you can easily test.

Learning curve is not a factor, as you'd be using the JPA API which is identical no matter which implementation you use.
Nakataa Kokuyo
Ranch Hand

Joined: Jul 24, 2011
Posts: 184
Ulf Dittmer wrote:
Nakataa Kokuyo wrote:Best in the sense of better performance and most robust. and if possible, shorter learning curve

Performance probably depends a lot on your DB, so it's not easy for someone else to make a meaningful recommendation. It's also something you can easily test.

Learning curve is not a factor, as you'd be using the JPA API which is identical no matter which implementation you use.


Thanks Ulf, what about popularity? pro and cons to pair with Hibernate and EJB.

I'm reading on Pro JPA2, it is more toward to EJB, and be honest, i see myself confuse on EJB3, just a Entity manager, persistence context and transactional have caused me confuse

Between, if pairing JPA with hibernate, do we need to understand the same concept or would the implementation be more directly? i can't seem find a book to mentioned just JPA and hibernate, probably guru here can point me out
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41591
    
  55
I think you're confusing several different concepts. You're using either the EJB API or the JPA API, not both. Unless you're already using a JEE server, or have other reasons to use EJBs, I'd choose JPA instead - it can be deployed in a servlet container (EJBs can't).

JPA is an API for which several implementations are available: EclipseLink, Hibernate, OpenJPA, etc. You still have to choose one of those implementations after you've decided to use JPA itself.
Nakataa Kokuyo
Ranch Hand

Joined: Jul 24, 2011
Posts: 184
Ulf Dittmer wrote:I think you're confusing several different concepts. You're using either the EJB API or the JPA API, not both. Unless you're already using a JEE server, or have other reasons to use EJBs, I'd choose JPA instead - it can be deployed in a servlet container (EJBs can't).

JPA is an API for which several implementations are available: EclipseLink, Hibernate, OpenJPA, etc. You still have to choose one of those implementations after you've decided to use JPA itself.


Hi Ulf,

I think i would further study to JPA and Hibernate implementation, what is the recommended reference for these? appreciated your guidance !

 
 
subject: what is the best pairing with JPA?