Datanucleus JDO - 我需要什么罐子?

发布于 2025-01-07 13:27:59 字数 1107 浏览 0 评论 0原文

背景

我正在学习 Java,并正在构建一个 Web 应用程序作为研究(边做边学)。我决定使用 JDO(datanucleus) 和 H2 来实现持久性。我是 Java 语言的新手,所以请随意认为我可悲地无知 =)

问题:

我的类路径中需要包含哪些 Jars?我目前有:

  • api-jdo-3.0.0
  • core-3.0.0
  • rdbms-3.0.0
  • jdo-api-3.1 (javax.jdo package)
  • log4j-1.2.14

我已阅读 Datanucleus.org 我已经下载了“accessplatform-rdbms-3.0.0-release”来自sourceforge。我还安装了 Eclipse(indigo) 的 datanucleus 插件。

要选择上面的那些:我打开了 jar 并查找了文档中引用的类,并且我还找到了该站点 MavenHub (顺便说一句,我没有使用 maven),看起来那里有一个依赖项列表。然而,访问平台包含它自己的“api-jdo-3.0.0”jar(除了 deps\ 文件夹中的 Apache jar)和一个“rdbms-3.0.0”jar。 MavenHub 依赖项列表中没有提到这些。

我知道有些罐子提供了我不需要的附加功能,但我似乎找不到“基本”实现列表。 lib/ 文件夹中有 14 个 jar(例如“jdo-query-3.0.0”看起来非常重要)。任何人都可以在这方面给我建议,或者更好的是,启发我(链接一个手持教程或我可以使用的 MavenHub 等资源)?

(我对 MavenHub 列表有点怀疑,因为它似乎过于简短。)

感谢您帮助我

编辑:

移动了答案,因此问题显示为已回答。

Context:

I am learning Java, and am building a web application as a study(learn by doing). I've decided to use JDO(datanucleus) and H2 for persistence. I am a novice with the Java language, so feel free to consider me pathetically ignorant =)

Question:

Which of the included Jars are required in my classpath? I currently have:

  • api-jdo-3.0.0
  • core-3.0.0
  • rdbms-3.0.0
  • jdo-api-3.1 (javax.jdo package)
  • log4j-1.2.14

I have read through the documentation at Datanucleus.org and I have downloaded the "accessplatform-rdbms-3.0.0-release" from sourceforge. I have also installed the datanucleus plugin for Eclipse(indigo).

To select the ones I have above: I opened up the jars and hunted down the classes referenced in the documentation, and I also found the site MavenHub (I'm not using maven btw) and it looks like there is a dependency listing there. However the access platform contains its own "api-jdo-3.0.0" jar (in addition to the Apache one in the deps\ folder) and a "rdbms-3.0.0" jar. Neither of these are mentioned in the MavenHub dependency list.

I understand that some of the jars provide additional features that I wont need, but I cant seem to find a "basic" implementation list. There are 14 jars in the lib/ folder ("jdo-query-3.0.0" looks pretty important for example). Can anyone advise me on this, or better yet, enlighten me (link a hand holding tutorial or a resource like MavenHub i can use)?

(I was kinda dubious about the MavenHub list because it seemed overly brief.)

Thanks for helping me out

EDIT:

Moved Answer so question appears as answered.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

兮颜 2025-01-14 13:27:59

我在网站和教程下载中都找到了它。

对于任何其他人:

正如 DataNucleus 指出的那样;在网站上,它位于“增强课程”部分下指南的。

src/java/org/datanucleus/samples/jdo/tutorial/Book.java
src/java/org/datanucleus/samples/jdo/tutorial/Inventory.java
src/java/org/datanucleus/samples/jdo/tutorial/Product.java

target/classes/org/datanucleus/samples/jdo/tutorial/Book.class
target/classes/org/datanucleus/samples/jdo/tutorial/Inventory.class
target/classes/org/datanucleus/samples/jdo/tutorial/Product.class

lib/jdo-api.jar
lib/datanucleus-core.jar
lib/datanucleus-api-jdo.jar
lib/datanucleus-enhancer.jar
lib/asm.jar

另一个位置是在 Datanucleus Sourceforge 上,有示例:

“datanucleus-samples-jdo- “tutorial-3.0-src.zip”中有几个自述文件,在这些文件中,它列出了必要的文件:

DataNucleus Tutorial for JDO at the CommandLine
===============================================
Download the necessary jars and put them into the lib/ directory
You will need :-
datanucleus-core.jar
datanucleus-enhancer.jar
datanucleus-api-jdo.jar
datanucleus-rdbms.jar
asm.jar (3.0)
log4j.jar (1.2.*)
jdo-api.jar (3.0)
(your-jdbc-driver.jar)

网站上的列表很容易被错过(尽管我看了几次)。此外,您必须从 Apache jdo-api.jar 导入(非此即彼):

javax.jdo.annotations.[classes];
javax.jdo.[classes]; 

才能在类中使用注释,并根据您在类中执行的操作来引用持久性管理器。

I found it, both on the website and in the tutorial downloads.

For any others:

As DataNucleus pointed out; on the website it is under the "enhance your classes" section of the guide.

src/java/org/datanucleus/samples/jdo/tutorial/Book.java
src/java/org/datanucleus/samples/jdo/tutorial/Inventory.java
src/java/org/datanucleus/samples/jdo/tutorial/Product.java

target/classes/org/datanucleus/samples/jdo/tutorial/Book.class
target/classes/org/datanucleus/samples/jdo/tutorial/Inventory.class
target/classes/org/datanucleus/samples/jdo/tutorial/Product.class

lib/jdo-api.jar
lib/datanucleus-core.jar
lib/datanucleus-api-jdo.jar
lib/datanucleus-enhancer.jar
lib/asm.jar

The other location is on the Datanucleus Sourceforge, there are samples:

"datanucleus-samples-jdo-tutorial-3.0-src.zip" has several Readme files in it and in those files, it lists the necessary files:

DataNucleus Tutorial for JDO at the CommandLine
===============================================
Download the necessary jars and put them into the lib/ directory
You will need :-
datanucleus-core.jar
datanucleus-enhancer.jar
datanucleus-api-jdo.jar
datanucleus-rdbms.jar
asm.jar (3.0)
log4j.jar (1.2.*)
jdo-api.jar (3.0)
(your-jdbc-driver.jar)

The listing on the site is easy to miss, (I did despite looking several times). Additonally, you have to import (either-or):

javax.jdo.annotations.[classes];
javax.jdo.[classes]; 

from the Apache jdo-api.jar to use annotations in your classes, and to reference the Persistence Managers depending on what your doing in the class.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文