TJDO Tutorial: Step 4

Step 1 | Step 2 | Step 3 | Step 4 | Step 5

Step 4: Compile and enhance the classes

All of the code is written and the metadata file is defined. The next step is to compile and enhance the classes.

Compile

The compilation step is accomplished the same way you would compile any other java source file --- by using javac (or jikes or any other java compiler):

javac -classpath "tjdo.jar;jdo.jar" test/*.java

Enhance

Now, we run the class enhancer to make the class PersistenceCapable. The enhancer is a class file post-processor that adds some fields and methods to a PersistenceCapable class. These additions communicate with a JDO StateManager at runtime to transparently persist the class.

You can run the class enhancer with:

java -cp ".;tjdo.jar;jdo.jar;jdori.jar;commons-logging.jar" com.triactive.jdo.enhance.SunReferenceEnhancer test/*.jdo


TJDO Home SourceForge.net