By Sanjeeb.Sahoo@Sun.COM/12 Dec 2005 Introduction: ------------- This is a simple Annotation Processing Tool (APT) that can be used during compilation process to automatically populate the managed persistence class list in persistence.xml. A managed persistence class is a Java class that is annotated as @Entity or @Embeddable or @EmbeddableSuperclass. To build: --------- set glassfish.home in build.xml Run 'ant clean build' To run: ------- apt -d samples/classes/ -cp $GLASSFISH_HOME/lib/javaee.jar:$GLASSFISH_HOME/lib/appserv-ws.jar:`pwd`/build/apt.jar -Add=samples/persistence.xml samples/src/sahoo/*.java See the above command is invoked just like you invoke javac. In fact it does what ever javac does + more. The only non-javac option used here is -Add which is used by our annotation processor to identify the input persistence.xml file. The above command picks up Java sources from samples/src dir and persistence.xml from samples dir. It produces the new persistence.xml in samples/classes/META-INF dir. It produces the classes in samples/build directory. References: ----------- apt documentation in Java SE: http://java.sun.com/j2se/1.5.0/docs/guide/apt/index.html Using Java Persistence API in Java SE environment: https://glassfish.dev.java.net/javaee5/persistence/entity-persistence-support.html#Java_SE JAXB 2.0: http://jaxb.dev.java.net Known Issues: ------------- Please note, EmbeddableSuperclass is being renamed to MappedSuperclass. When that happens, we need to change source code as well.