Java JPA 2.0 的 jar 文件

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2243147/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-13 05:10:17  来源:igfitidea点击:

jar file for JPA 2.0

javajpajakarta-eejava-ee-6

提问by user246160

import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.CriteriaQuery;
import javax.persistence.criteria.Root;

I've created a JPA project where I try to user the above classes but I'm unable to find what jar I'm missing for them. Please guide me.

我已经创建了一个 JPA 项目,我尝试在其中使用上述类,但我无法找到我缺少的 jar。请指导我。

采纳答案by DataNucleus

回答by Pascal Thivent

EclipseLink provides the JPA 2.0 Reference Implementation which is officially out since Java EE 6 is out. You'll find these classes in the jars bundled in eclipselink-2.0.0.v20091127-r5931.zip. If you are looking for a Maven repo, have a look at this page.

EclipseLink 提供了 JPA 2.0 参考实现,它在 Java EE 6 发布后正式发布。您将在eclipselink-2.0.0.v20091127-r5931.zip 中捆绑的 jars 中找到这些类。如果您正在寻找 Maven 存储库,请查看此页面

回答by ryenus

A slightly better answer (since 2011) is to use the one from maven central, i.e.,

一个稍微好一点的答案(自 2011 年以来)是使用 maven central 中的一个,即,

org.hibernate.javax.persistence:hibernate-jpa-2.0-api:1.0.1-Final

OR

或者

<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.0-api</artifactId>
<version>1.0.1.Final</version>

See: http://repo1.maven.org/maven2/org/hibernate/javax/persistence/hibernate-jpa-2.0-api/1.0.1.Final/

见:http: //repo1.maven.org/maven2/org/hibernate/javax/persistence/hibernate-jpa-2.0-api/1.0.1.Final/

For all the available versions, especially the latest, see http://repo1.maven.org/maven2/org/hibernate/javax/persistence/hibernate-jpa-2.0-api/

有关所有可用版本,尤其是最新版本,请参阅http://repo1.maven.org/maven2/org/hibernate/javax/persistence/hibernate-jpa-2.0-api/

回答by A. Rick

These files are found in the javax.persistencejar file. The Eclipse version of the javax.persistencejar file can be found on Maven Central. Or you can add the following dependency in your project's pom.xmlfile to get Maven to pull it down for you.

这些文件位于javax.persistencejar 文件中。可以在Maven Central上找到javax.persistencejar 文件的 Eclipse 版本。或者,您可以在项目文件中添加以下依赖项,让 Maven 为您下拉。pom.xml

    <dependency>
        <groupId>org.eclipse.persistence</groupId>
        <artifactId>javax.persistence</artifactId>
        <version>2.1.1</version>
        <scope>compile</scope>
    </dependency>