mirror of
https://github.com/querydsl/querydsl.git
synced 2026-06-24 21:07:26 +08:00
added hashCode implementation
This commit is contained in:
parent
95671018bc
commit
a0fb9610e4
@ -48,7 +48,15 @@ public class APTFactory implements AnnotationProcessorFactory {
|
||||
Set<AnnotationTypeDeclaration> atds,
|
||||
AnnotationProcessorEnvironment env) {
|
||||
try {
|
||||
return new GeneralProcessor(env, jpaSuperClass, jpaEntity, qdDto, jpaEmbeddable);
|
||||
try {
|
||||
// try JPA first
|
||||
Class.forName(jpaSuperClass);
|
||||
return new GeneralProcessor(env, jpaSuperClass, jpaEntity, qdDto, jpaEmbeddable);
|
||||
} catch (ClassNotFoundException e) {
|
||||
// try Querydsl specific next
|
||||
return new GeneralProcessor(env, null, qdEntity, qdDto, null);
|
||||
}
|
||||
|
||||
} catch (IOException e) {
|
||||
String error = "Caught " + e.getClass().getName();
|
||||
throw new RuntimeException(error, e);
|
||||
|
||||
@ -78,12 +78,17 @@ public class GeneralProcessor implements AnnotationProcessor {
|
||||
EntityVisitor superclassVisitor = new EntityVisitor();
|
||||
|
||||
// mapped superclass
|
||||
AnnotationTypeDeclaration a = (AnnotationTypeDeclaration) env
|
||||
.getTypeDeclaration(superClassAnnotation);
|
||||
for (Declaration typeDecl : env.getDeclarationsAnnotatedWith(a)) {
|
||||
typeDecl.accept(getDeclarationScanner(superclassVisitor, NO_OP));
|
||||
}
|
||||
Map<String, Type> mappedSupertypes = superclassVisitor.types;
|
||||
AnnotationTypeDeclaration a;
|
||||
Map<String, Type> mappedSupertypes;
|
||||
if (superClassAnnotation != null){
|
||||
a = (AnnotationTypeDeclaration) env.getTypeDeclaration(superClassAnnotation);
|
||||
for (Declaration typeDecl : env.getDeclarationsAnnotatedWith(a)) {
|
||||
typeDecl.accept(getDeclarationScanner(superclassVisitor, NO_OP));
|
||||
}
|
||||
mappedSupertypes = superclassVisitor.types;
|
||||
}else{
|
||||
mappedSupertypes = new HashMap<String,Type>();
|
||||
}
|
||||
|
||||
// domain types
|
||||
EntityVisitor entityVisitor = new EntityVisitor();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user