简体   繁体   English

TopLink-JPA类在哪里

[英]TopLink - Where are the JPA classes

Does Oracle TopLink not include the JPA classes? Oracle TopLink是否不包括JPA类?

I am trying to create a JPA/TopLink project. 我正在尝试创建一个JPA / TopLink项目。 I have downloaded the latest version of the TopLink jar (12c 12.1.2) and made sure to include it in the classpath. 我已经下载了最新版本的TopLink jar (12c 12.1.2),并确保将其包含在类路径中。

The problem is that I cannot seem to find any of the javax.persistence.* classes like Entity, Column etc. I though that all implementations of JPA such as TopLink, Hibernate etc would include those classes. 问题是我似乎找不到像Entity,Column等之类的任何javax.persistence。*类。尽管JPA的所有实现(例如TopLink,Hibernate等)都将包括这些类。 Is that not true? 那不是真的吗 How else should I get this JPA/Toplink project to work? 我还应该如何使该JPA / Toplink项目正常工作?

According to this article, Toplink 12.1.2 is built off of EclipseLink and supplies extra goodies such as support for RESTful services, meaning the javax.persistence.* packages are contained within the eclipselink.jar file. 根据文章的Toplink 12.1.2是建立关闭的EclipseLink和建筑材料其他好处如RESTful服务,这意味着支持javax.persistence.*包都包含在中eclipselink.jar文件。 This file should exist within the jlib folder of the toplink.zip download. 该文件应该存在于toplink.zip下载的jlib文件夹中。

You can find your javax.* classes in the jars supplied with any Java EE compliant server (you can find the jar somewhere in the lib folder usually). 您可以在任何与Java EE兼容的服务器随附的jar中找到javax.*类(通常可以在lib文件夹中的某个位置找到jar)。 If you use maven: 如果使用maven:

<dependency>
    <groupId>javax</groupId>
    <artifactId>javaee-api</artifactId>
    <version>7.0</version>
</dependency>

Or download the jar directly (version 7): 或直接下载jar(版本7):

http://mvnrepository.com/artifact/javax/javaee-api/7.0 http://mvnrepository.com/artifact/javax/javaee-api/7.0

Put it on your relevant classpath and everything should work (im not sure about toplink, you might need version 6 of API - which can be also found in maven repositories). 将其放在相关的类路径上,一切都应该工作(不确定toplink,您可能需要API版本6-也可以在maven存储库中找到该版本)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM