Reputation: 286
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:
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.
Upvotes: 1
Views: 1593
Reputation: 286
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.
Upvotes: 1