java 如何找到JPA的版本?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3520577/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to find the version of JPA?
提问by Nav
How to understand What JPA version I'm using in EJB? Is JPA built-in EJB?
如何理解我在 EJB 中使用的 JPA 版本?JPA 是内置的 EJB 吗?
Regards
问候
回答by Pascal Thivent
With a Java EE 5 container, you get JPA 1.0 (specified in the JSR 220 - Enterprise JavaBeans, Version 3.0).
使用 Java EE 5 容器,您将获得 JPA 1.0(在JSR 220 - Enterprise JavaBeans, Version 3.0 中指定)。
With a Java EE 6 container, you get JPA 2.0 (specified in the JSR 317: Java Persistence 2.0which is now dedicated).
使用 Java EE 6 容器,您将获得 JPA 2.0(在JSR 317:Java Persistence 2.0 中指定,现在是专用的)。
And if you are providing your own JPA implementation, well, it depends on the implementation and the version you provide :)
如果您提供自己的 JPA 实现,那么这取决于您提供的实现和版本:)
Here are some JPA 2.0 implementations and their respective versions:
以下是一些 JPA 2.0 实现及其各自的版本:
- EclipseLink 2.0+
- Hibernate EntityManager 3.5+
- OpenJPA 2.0+
- DataNucleus 2.1.0+
- EclipseLink 2.0+
- 休眠实体管理器 3.5+
- OpenJPA 2.0+
- 数据核 2.1.0+
回答by toxicatedblood
No JPA and EJBs are not related at all, they are totally independent. JPA is not built in EJBs. The javaee-api 6 which is the JAVA EE 6 container gives you the code for EJB 3 and JPA 2.+. In order to implement EJB3 you can use weblogic or JBoss or any application container. To implement JPA you can use hibernate, OpenJPA etc.
没有 JPA 和 EJB 完全不相关,它们是完全独立的。JPA 不是内置在 EJB 中的。作为 JAVA EE 6 容器的 javaee-api 6 为您提供了 EJB 3 和 JPA 2.+ 的代码。为了实现 EJB3,您可以使用 weblogic 或 JBoss 或任何应用程序容器。要实现 JPA,您可以使用 hibernate、OpenJPA 等。
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>6.0</version>
</dependency>

