Class AnnotationProcessor6
java.lang.Object
javax.annotation.processing.AbstractProcessor
org.apache.openjpa.persistence.meta.AnnotationProcessor6
- All Implemented Interfaces:
Processor
@SupportedAnnotationTypes({"jakarta.persistence.Entity","jakarta.persistence.Embeddable","jakarta.persistence.MappedSuperclass"})
@SupportedOptions({"openjpa.log","openjpa.source","openjpa.naming","openjpa.header","openjpa.metamodel","openjpa.addGeneratedAnnotation"})
public class AnnotationProcessor6
extends AbstractProcessor
Annotation processing tool generates source code for a meta-model class given
the annotated source code of persistent entity.
Usage
will generate source code for canonical meta-model class
This tool is invoked during compilation for JDK6 compiler if
- OpenJPA and JPA libraries are available in the compiler classpath and
- Annotation Processor option
-Aopenjpa.metamodel=trueis specified.
Usage
$ javac -classpath path/to/openjpa-all.jar -Aopenjpa.metamodel=true mypackage/MyEntity.javawill generate source code for canonical meta-model class
mypackage.MyEntity_.java.
The source code is generated relative to the directory specified in -s option
of javac compiler and defaulted to the current directory.
The Annotation Processor also recognizes the following options (none of them are mandatory):
| -Aopenjpa.log={log level} | The logging level. Default is WARN. Permissible values are
TRACE, INFO, WARN or ERROR.
|
| -Aopenjpa.source={n} | Java source version of the generated code. Default is 6.
|
| -Aopenjpa.naming={class name} | fully-qualified name of a class implementing
org.apache.openjpa.meta.MetaDataFactory that determines
the name of a meta-class given the name of the original persistent Java entity class. Defaults to
org.apache.openjpa.persistence.PersistenceMetaDataFactory which appends a underscore character
(_) to the original Java class name.
|
| -Aopenjpa.header={url} |
A url whose content will appear as comment header to the generated file(s). Recognizes special value
ASL for Apache Source License header as comment. By default adds a OpenJPA proprietary
text.
|
- Since:
- 2.0.0
- Author:
- Pinaki Poddar
-
Field Summary
Fields inherited from class javax.annotation.processing.AbstractProcessor
processingEnv -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidinit(ProcessingEnvironment processingEnv) Initialization.booleanprocess(Set<? extends TypeElement> annos, RoundEnvironment roundEnv) The entry point for java compiler.Methods inherited from class javax.annotation.processing.AbstractProcessor
getCompletions, getSupportedAnnotationTypes, getSupportedOptions, isInitialized
-
Constructor Details
-
AnnotationProcessor6
public AnnotationProcessor6()
-
-
Method Details
-
getSupportedSourceVersion
- Specified by:
getSupportedSourceVersionin interfaceProcessor- Overrides:
getSupportedSourceVersionin classAbstractProcessor
-
init
Initialization.- Specified by:
initin interfaceProcessor- Overrides:
initin classAbstractProcessor
-
process
The entry point for java compiler.- Specified by:
processin interfaceProcessor- Specified by:
processin classAbstractProcessor
-