mirror of
https://github.com/querydsl/querydsl.git
synced 2026-06-30 21:08:30 +08:00
This commit is contained in:
parent
f0754528a0
commit
6825176bab
@ -440,7 +440,7 @@ public class Processor {
|
||||
Element superTypeElement = env.getTypeUtils().asElement(superTypeMirror);
|
||||
if (superTypeElement != null
|
||||
&& !superTypeElement.toString().startsWith("java.lang.")
|
||||
&& superTypeElement.getAnnotationMirrors().isEmpty()) {
|
||||
&& !hasKnownAnnotation(superTypeElement)) {
|
||||
typeFactory.getEntityType(superTypeMirror, false);
|
||||
superTypeMirrors.add(superTypeMirror);
|
||||
elements.add(superTypeElement);
|
||||
@ -470,6 +470,22 @@ public class Processor {
|
||||
|
||||
mergeTypes(types, superTypes);
|
||||
}
|
||||
|
||||
private boolean hasKnownAnnotation(Element element) {
|
||||
if (configuration.getEmbeddableAnnotation() != null && element.getAnnotation(configuration.getEmbeddableAnnotation()) != null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (configuration.getSupertypeSerializer() != null && element.getAnnotation(configuration.getSuperTypeAnnotation()) != null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (element.getAnnotation(configuration.getEntityAnnotation()) != null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private void processDelegateMethod(Element delegateMethod, boolean cached) {
|
||||
ExecutableElement method = (ExecutableElement)delegateMethod;
|
||||
@ -550,7 +566,7 @@ public class Processor {
|
||||
Element superTypeElement = env.getTypeUtils().asElement(superTypeMirror);
|
||||
if (superTypeElement != null
|
||||
&& !superTypeElement.toString().startsWith("java.lang.")
|
||||
&& superTypeElement.getAnnotationMirrors().isEmpty()) {
|
||||
&& !hasKnownAnnotation(superTypeElement)) {
|
||||
typeFactory.getEntityType(superTypeMirror, false);
|
||||
superTypeMirrors.add(superTypeMirror);
|
||||
elements.add(superTypeElement);
|
||||
|
||||
@ -27,6 +27,8 @@ public class EmbeddableDeepTest {
|
||||
|
||||
}
|
||||
|
||||
// JPA
|
||||
|
||||
@Entity
|
||||
public class A extends AEntity {
|
||||
|
||||
@ -50,4 +52,29 @@ public class EmbeddableDeepTest {
|
||||
|
||||
}
|
||||
|
||||
// plain
|
||||
|
||||
// @QueryEntity
|
||||
// public class AA extends AValueObject {
|
||||
//
|
||||
// @QueryEmbedded
|
||||
// BB b;
|
||||
//
|
||||
// }
|
||||
//
|
||||
// @QueryEmbeddable
|
||||
// public class BB extends AValueObject {
|
||||
//
|
||||
// @QueryEmbedded
|
||||
// CC c;
|
||||
//
|
||||
// }
|
||||
//
|
||||
// @QueryEmbeddable
|
||||
// public class CC extends AValueObject {
|
||||
//
|
||||
// SomeType someType;
|
||||
//
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
@ -14,4 +14,6 @@ Import-Template:
|
||||
net.sf.cglib.proxy.*;version="${cglib.version}",
|
||||
org.apache.commons.collections15.*;version="${commons.collections.version}",
|
||||
org.apache.commons.lang.*;version="${commons.lang.version}"
|
||||
|
||||
Excluded-Imports:
|
||||
edu.umd.cs.findbugs.annotations.*,
|
||||
net.jcip.annotations.*
|
||||
Loading…
Reference in New Issue
Block a user