在哪里可以找到JPA2 Maven依赖关系? [英] Where can I find a JPA2 Maven dependency?
问题描述
我正在尝试构建一个依赖于JPA2的实现不可知的maven模块。不幸的是,唯一的Maven JPA依赖关系是基于JPA1,因此,我不能使用EntityManager.detach()方法,因为它只是JPA2选项。
I'm trying to build an implementation agnostic maven module which relies on JPA2. Unfortunately, the only Maven JPA dependency is JPA1 based, and consequently, I cannot use EntityManager.detach() method as that is a JPA2 option only.
理想情况下, d希望能够在我的Pom中指定我的javax.persistence依赖项,并要求应用程序/容器提供JPA2实现。不幸的是,我找不到任何这样的依赖。
Ideally, I'd love to be able to specify my javax.persistence dependency in my Pom, and require the app/container to supply the JPA2 implementation. Unfortunately, I cannot find any such dependency.
在这一点上,我唯一的选择是声明hibernate-jpa-2.0-api 1.0.0.FINAL作为提供的依赖关系?
Is my only choice at this point to declare hibernate-jpa-2.0-api 1.0.0.FINAL as a provided dependency?
推荐答案
Hibernate JPA 2类(javax.persistence ...)在这里:
The Hibernate JPA 2 classes (javax.persistence...) are here:
<dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.0-api</artifactId>
<version>1.0.1.Final</version>
</dependency>
这篇关于在哪里可以找到JPA2 Maven依赖关系?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!