问题:
I understand that JPA 2 is a specification and Hibernate is a tool for ORM. 我知道JPA 2是一个规范,而Hibernate是ORM的工具。 Also, I understand that Hibernate has more features than JPA 2. But from a practical point of view, what really is the difference? 另外,我了解到Hibernate具有比JPA 2更多的功能。但是从实际的角度来看,真正的区别是什么?
I have experience using iBatis and now I'm trying to learn either Hibernate or JPA2. 我有使用iBatis的经验,现在我正在尝试学习Hibernate或JPA2。 I picked up Pro JPA2 book and it keeps referring to "JPA provider". 我拿起Pro JPA2书籍,并且一直指“ JPA提供者”。 For example: 例如:
If you think a feature should be standardized, you should speak up and request it from your JPA provider 如果您认为某个功能应该被标准化,则应该大声疾呼并向您的JPA提供者提出要求
This confuses me so I have a few questions: 这使我感到困惑,所以我有几个问题:
- Using JPA2 alone can I fetch data from DB by simply annotating my POJO's 我可以单独使用JPA2注释POJO即可从数据库中获取数据
- Is JPA2 supposed to be used with a "JPA Provider" eg TopLink or Hibernate? JPA2是否应该与“ JPA Provider”一起使用,例如TopLink或Hibernate? If so, then what's the benefit of using JPA2 + Hibernate as compared to JPA2 alone, or compared to Hibernate alone ? 如果是这样,那么与单独使用JPA2或单独使用Hibernate相比,使用JPA2 + Hibernate有什么好处?
- Can you recommend a good practical JPA2 book. 您能推荐一本实用的JPA2书籍吗? "Pro JPA2" seems more like a bible and reference on JPA2 (It doesn't get into Queries until the later half of the book). “ Pro JPA2”似乎更像是一本关于JPA2的圣经和参考书(直到本书的后半部分才进入Queries)。 Is there a book that takes a problem/solution approach to JPA2? 是否有一本书针对JPA2采用问题/解决方法?
解决方案:
参考一: https://stackoom.com/question/fSep/JPA和Hibernate有什么区别-关闭参考二: https://oldbug.net/q/fSep/What-s-the-difference-between-JPA-and-Hibernate-closed
来源:oschina
链接:https://my.oschina.net/u/4432649/blog/4339265