views:

166

answers:

2

I was wondering if anyone has experience with the JPA2.0 implementation of any of those frameworks? Especially together with Spring3.x which comes with EclipseLink support.

Do you use any of those frameworks and JPA2.0 for production? Any severe issues?

+1  A: 

EclipseLink is more standards compliant, since it is the reference implementation for JPA 2, Hibernate has some compliancy issues, but is more mature.

One of the main benefits of EclipseLink is that you can call native SQL functions directly in your JPQL queries. In Hibernate this is not directly possible.

But Hibernate has a bigger community, better documentation and also better error messages.

Timo Westkämper
I disagree. Being the RI doesn't make you more compliant and I've faced issue with both implementations although they are supposed to be JPA 2.0 compliant, see [this question for example](http://stackoverflow.com/questions/3014313/jpa-2-criteria-api-why-is-isnull-being-ignored-when-in-conjunction-with-equal). The TCK is just not exhaustive.
Pascal Thivent
@pascal-thivent, EclipseLink's JPQL implementation is in fact more standards compliant then Hibernate's. And being the RI puts you into some kind of reference position.
Timo Westkämper
Since I've faced compliance issues with both, my reference is the spec, I learned that I can't use EclipseLink as "reference".
Pascal Thivent
Fair enough, my compliance experience is restricted to the JPQL part. I have used the full grammar of both for Querydsl translation and had more compliance issues with Hibernate.
Timo Westkämper
Well, the reason for my question is that I believe to have a comliance issue, too. Pascal already tried to help, but it didn't work (see http://stackoverflow.com/questions/3225103/hiberate-jpa-nullable-values-objects). Briefly, I am trying to make use of nullable attributes, and Hibernate/MySQL don't behave like expected. I've tried the same with EclipseLink (identical code) and it works. However, you say that EclipeLink has it's own issues. That is really, really sad. Would it be appropiate to say: It is better NOT to make use of JPA2 at all and use pure Hibernate syntax instead?
@erlord, if this a Hibernate bug, then file it as an issue in the Hibernate JIRA. I'd still continue using JPA annotations and annotation based configuration.
Timo Westkämper
@Timo I agree that Hibernate has some "glitches" with JPQL @erlord I've faced bugs with all the major JPA implementations and believe things will get better with time and I still continue to use JPA. In your particular case, I would suggest to use a `Float` anyway to be able to set it to `null` at the object level. But there is indeed a bug and you should report it.
Pascal Thivent
@all: please, consider my self-answer of previously mentioned issue at http://stackoverflow.com/questions/3225103/hiberate-jpa-nullable-values-objects ... that was not a Hibernate bug, but a bug of my capabilities ;-) Hence, I will carry on with Hibernate, just because of the bigger community, and with JPA2, because it is standard
+2  A: 

IMHO It is always better to use a standard api where possible. Your own example shows this perfectly. You were able to try your identical code on two providers when one failed to work as expected. Switching to any native API prevents you from doing this.

If using EclipseLink as your JPA 2.0 provider works well for you, then use it. If you do happen to run into an issue, file an EclipseLink bug, and get help on this forum, or the EclipseLink forums and Newsgroups.

Peter

Peter Krogh
Thanks, I will do so and feel much better with this decision.