问题描述
我使用了以下 JPA 实现:
I have made use of the following JPA implementations:
- 休眠,
- 顶部链接,
- OpenJPA
他们每个人都有自己的长处和短处.我发现 Hibernate 是三者中最先进的,除了它将自己的一些增强功能与 JPA 混合在一起,这使得很难切换到其他提供者.最重要的是,它的查询解析器在解释 JPA 时要宽松得多.它们使得获得正确的库来支持 hibernate 有点困难,因为我发现尝试获得所有依赖项的正确版本是一项任务.
Each of them has their own strengths and weaknesses. I found Hibernate the most advanced of the three except that it mixed some of its own enhancements with JPA which made it difficult to switch out to other providers. Most importantly, its query parser was much more lenient when interpreting JPA. They make it slightly difficult to get the correct libraries to support hibernate because I found it a mission trying to get the right versions of all the dependencies.
Toplink 还可以,但有人觉得它有点残缺,因为 Oracle 似乎希望您使用/购买?他们更先进的图书馆.尝试下载它也是一项任务,因为您需要通过运行 jar 文件来安装它.我发现它只实现了基本的 JPA 规范.我使用它的原因是 hibernate 使用了很多在其他开源项目中常用的库,人们经常会遇到类加载器问题,尤其是在使用 JBoss 时
Toplink was ok but one is left with the feeling that it is slightly crippled as it seems Oracle wants you to use/buy? their more advanced library. Trying to download it was also a mission because you need to install it via running a jar file. I found that it implemented only the base JPA spec. The reason I used it was hibernate uses a lot of libraries that are commonly used in other open source projects that one would often get classloarder problems, especially when using JBoss
OpenJPA - 它拥有迄今为止最好的文档,易于下载和使用,但它似乎有很多问题.也许它只是我的代码,但我发现更高级用法的代码,例如与 CascadeType.all 设置的 OneToMany 关系似乎不起作用.诚然,这可能是我的代码错了,我还没有时间测试一个干净的案例,但是很多这样的事件让我害怕使用它.我真的希望它变得更好.它的错误信息通常对帮助解决问题没有帮助.
OpenJPA - This has by far the best documentation and is easy to download and use but it seems its very buggy. Maybe its just my code but code I found more advanced usage such as OneToMany relationships with CascadeType.all set just didn't seem to work. Admittedly It may be my code that was wrong and I haven't had time to test a clean case but many incidents like this leave me scared to use it. I really hope it gets better. Its error messages are often useless in helping solve the problem.
人们使用过哪些其他图书馆?他们更喜欢哪些图书馆?为什么?
What other libraries have people used and which ones do they prefer and why?
推荐答案
我对这些实现有相同的结论.
I had the same conclusions about these implementations.
OpenJPA 曾经/似乎有问题
OpenJPA was/seemed buggy
Hibernate 有大量的库,而且似乎不能延迟加载所有东西.
Hibernate had tons of libraries and seemed to have trouble with not lazy loading everything.
我接下来要尝试的是 JPOX,它最近更名为 datanucleus.
The one I would try next is JPOX, which has recently been renamed to datanucleus.
这篇关于JPA 实现 - 哪个最好用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!