4. Generation of Canonical MetaModel classes

Annotation processing tool generates source code for a metamodel class given the annotated source code of persistent entity. This tool is invoked during compilation for JDK6 compiler if OpenJPA and JPA libraries are specified in the compiler -processorpath option.

 $ javac -processor org.apache.openjpa.persistence.meta.AnnotationProcessor6 -processorpath path/to/openjpa-all.jar mypackage/MyEntity.java
    

will generate source code for canonical meta-model class mypackage.MyEntity_.java.

The Annotation Processor recognizes the following options specified in the command-line with -A (none of them are mandatory):