问题描述
显然,OpenJPA.我也看到了EclipseLink和Hibernate,但是功能上有明显的不同吗?
OpenJPA, obviously. I've also seen EclipseLink and Hibernate mentioned, but is there significant difference in capabilities?
推荐答案
大多数差异来自提供程序对OSGi的了解.例如,您可能需要像OSGi捆绑包一样包装Hibernate jars(或使用其他人已经包装的set-网络上有一些浮动的包装).
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).
有时候,提供程序会尝试以无法在OSGi环境中工作的方式进行类加载,因此如果您包装自己的文件或使用主要受支持的提供程序的非现场"功能,则需要注意这一点.
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.
您还需要确保提供程序将其自身注册为OSGi服务.这仅适用于OpenJPA,并且在Aries代码库中有一个EclipseLink适配器.我假设人们共享的Hibernate捆绑包也可以做到这一点.在此线程中,有关于如何为其他提供程序(尤其是DataNucleus)执行此操作的说明:
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/[email protected]/msg00251.html
这篇关于Apache Aries托管JPA支持哪些JPA提供程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!