我在哪里可以找到 JPA2 Maven 依赖项? [英] Where can I find a JPA2 Maven dependency?

查看:28
本文介绍了我在哪里可以找到 JPA2 Maven 依赖项?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试构建一个依赖于 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.

理想情况下,我希望能够在我的 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆