问题
OpenJPA, obviously. I've also seen EclipseLink and Hibernate mentioned, but is there significant difference in capabilities?
回答1:
Most differences come from how OSGi-aware the provider is. For example, you may need to wrap the Hibernate jars as OSGi bundles yourself (or use a set someone else has already wrapped - there are a few floating around on the web).
Occasionally providers try and do classloading in such a way that it won't work in an OSGi environment, so this is something to look out for if you wrap your own or use 'off-piste' features of the main supported providers.
You'll also need to make sure the provider registers itself as an OSGi service. This just works with OpenJPA, and there's an EclipseLink adapter in the Aries codebase. I assume the Hibernate bundles people have shared do this as well. There are instructions on how to do this for other providers (DataNucleus in particular) in this thread:
http://www.mail-archive.com/aries-user@incubator.apache.org/msg00251.html
回答2:
I have actually tested providers so I'm not giving you a theoretical answer.
For Aries JPA version 1.0.0
- OpenJPA works
- Hibernate does not work
- EclipseLink have not tried
Hibernate does not work because of an issue logged here: https://issues.apache.org/jira/browse/ARIES-978
Basically deployment fails, because of a missing bundle context. I think it would be safe to assume Aries only supports OpenJPA until they include Hibernate and EclipseLink in their regression tests/samples. I'll be watching for when/if that happens.
来源:https://stackoverflow.com/questions/10157556/which-jpa-providers-are-supported-by-apache-aries-managed-jpa