How to understand What JPA version I'm using in EJB? Is JPA built-in EJB?
Rega开发者_开发百科rds
With a Java EE 5 container, you get JPA 1.0 (specified in the 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.0 which is now dedicated).
And if you are providing your own JPA implementation, well, it depends on the implementation and the version you provide :)
Here are some JPA 2.0 implementations and their respective versions:
- EclipseLink 2.0+
- Hibernate EntityManager 3.5+
- OpenJPA 2.0+
- DataNucleus 2.1.0+
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.
<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>6.0</version>
</dependency>
精彩评论