mirror of
https://github.com/querydsl/querydsl.git
synced 2026-06-19 21:00:53 +08:00
removed querydsl-jdoql-apt
removed querydsl-hql-apt
This commit is contained in:
parent
d952cc4289
commit
affc08f0b7
@ -129,13 +129,13 @@ public class Processor {
|
||||
|
||||
private String namePrefix;
|
||||
|
||||
private Class<? extends Annotation> entityAnn;
|
||||
private final Class<? extends Annotation> entityAnn;
|
||||
|
||||
private Class<? extends Annotation> superTypeAnn;
|
||||
private final Class<? extends Annotation> superTypeAnn;
|
||||
|
||||
private Class<? extends Annotation> embeddableAnn;
|
||||
private final Class<? extends Annotation> embeddableAnn;
|
||||
|
||||
private Class<? extends Annotation> dtoAnn;
|
||||
private final Class<? extends Annotation> dtoAnn;
|
||||
|
||||
public Processor(ProcessingEnvironment env,
|
||||
Class<? extends Annotation> entityAnn,
|
||||
|
||||
@ -0,0 +1,42 @@
|
||||
package com.mysema.query.hql.apt;
|
||||
|
||||
import java.lang.annotation.Annotation;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.annotation.processing.AbstractProcessor;
|
||||
import javax.annotation.processing.RoundEnvironment;
|
||||
import javax.annotation.processing.SupportedAnnotationTypes;
|
||||
import javax.annotation.processing.SupportedSourceVersion;
|
||||
import javax.lang.model.SourceVersion;
|
||||
import javax.lang.model.element.TypeElement;
|
||||
import javax.tools.Diagnostic;
|
||||
|
||||
import com.mysema.query.annotations.Projection;
|
||||
import com.mysema.query.apt.Processor;
|
||||
|
||||
/**
|
||||
* @author tiwe
|
||||
*
|
||||
*/
|
||||
@SupportedAnnotationTypes("*")
|
||||
@SupportedSourceVersion(SourceVersion.RELEASE_6)
|
||||
public class JPAAnnotationProcessor extends AbstractProcessor{
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
|
||||
try {
|
||||
processingEnv.getMessager().printMessage(Diagnostic.Kind.NOTE, "Running " + getClass().getSimpleName());
|
||||
Class<? extends Annotation> entity = (Class)Class.forName("javax.persistence.Entity");
|
||||
Class<? extends Annotation> superType = (Class)Class.forName("javax.persistence.MappedSuperclass");
|
||||
Class<? extends Annotation> embeddable = (Class)Class.forName("javax.persistence.Embeddable");
|
||||
Class<? extends Annotation> dtoAnnotation = Projection.class;
|
||||
Processor p = new Processor(processingEnv, entity, superType, embeddable, dtoAnnotation, "Q");
|
||||
p.process(roundEnv);
|
||||
return true;
|
||||
} catch (ClassNotFoundException e) {
|
||||
throw new RuntimeException(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,42 @@
|
||||
package com.mysema.query.jdoql.apt;
|
||||
|
||||
import java.lang.annotation.Annotation;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.annotation.processing.AbstractProcessor;
|
||||
import javax.annotation.processing.RoundEnvironment;
|
||||
import javax.annotation.processing.SupportedAnnotationTypes;
|
||||
import javax.annotation.processing.SupportedSourceVersion;
|
||||
import javax.lang.model.SourceVersion;
|
||||
import javax.lang.model.element.TypeElement;
|
||||
import javax.tools.Diagnostic;
|
||||
|
||||
import com.mysema.query.annotations.Projection;
|
||||
import com.mysema.query.apt.Processor;
|
||||
|
||||
/**
|
||||
* @author tiwe
|
||||
*
|
||||
*/
|
||||
@SupportedAnnotationTypes("*")
|
||||
@SupportedSourceVersion(SourceVersion.RELEASE_6)
|
||||
public class JDOAnnotationProcessor extends AbstractProcessor{
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
|
||||
try {
|
||||
processingEnv.getMessager().printMessage(Diagnostic.Kind.NOTE, "Running " + getClass().getSimpleName());
|
||||
Class<? extends Annotation> entity = (Class)Class.forName("javax.jdo.annotations.PersistenceCapable");
|
||||
Class<? extends Annotation> superType = null; // ?!?
|
||||
Class<? extends Annotation> embeddable = (Class)Class.forName("javax.jdo.annotations.EmbeddedOnly");
|
||||
Class<? extends Annotation> dtoAnnotation = Projection.class;
|
||||
Processor p = new Processor(processingEnv, entity, superType, embeddable, dtoAnnotation, "Q");
|
||||
p.skipGetters().process(roundEnv);
|
||||
return true;
|
||||
} catch (ClassNotFoundException e) {
|
||||
throw new RuntimeException(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -45,7 +45,7 @@
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.mysema.querydsl</groupId>
|
||||
<artifactId>querydsl-hql-apt</artifactId>
|
||||
<artifactId>querydsl-apt</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
@ -31,7 +31,7 @@
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.mysema.querydsl</groupId>
|
||||
<artifactId>querydsl-jdoql-apt</artifactId>
|
||||
<artifactId>querydsl-apt</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
@ -35,9 +35,7 @@
|
||||
<module>../querydsl-apt</module>
|
||||
<module>../querydsl-apt-jdk5</module>
|
||||
<module>../querydsl-collections</module>
|
||||
<module>../querydsl-jdoql-apt</module>
|
||||
<module>../querydsl-jdoql</module>
|
||||
<module>../querydsl-hql-apt</module>
|
||||
<module>../querydsl-hql</module>
|
||||
<module>../querydsl-sql</module>
|
||||
<module>../querydsl-docs</module>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user