search supertypes for session getter in repository type
This commit is contained in:
parent
2cfe93cd88
commit
a541a64eec
|
@ -283,7 +283,7 @@ public class AnnotationMetaEntity extends AnnotationMeta {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
findSessionGetter( methodsOfClass );
|
findSessionGetter( element );
|
||||||
|
|
||||||
if ( managed ) {
|
if ( managed ) {
|
||||||
putMember( "class", new AnnotationMetaType(this) );
|
putMember( "class", new AnnotationMetaType(this) );
|
||||||
|
@ -301,14 +301,27 @@ public class AnnotationMetaEntity extends AnnotationMeta {
|
||||||
initialized = true;
|
initialized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void findSessionGetter(List<ExecutableElement> methodsOfClass) {
|
private void findSessionGetter(TypeElement type) {
|
||||||
if ( !containsAnnotation( element, Constants.ENTITY ) ) {
|
if ( !containsAnnotation( type, Constants.ENTITY ) ) {
|
||||||
for ( ExecutableElement method : methodsOfClass ) {
|
for ( ExecutableElement method : methodsIn( type.getEnclosedElements() ) ) {
|
||||||
if ( isSessionGetter( method ) ) {
|
if ( isSessionGetter( method ) ) {
|
||||||
dao = true;
|
dao = true;
|
||||||
sessionType = addDaoConstructor( method );
|
sessionType = addDaoConstructor( method );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if ( !dao ) {
|
||||||
|
final TypeMirror superclass = type.getSuperclass();
|
||||||
|
if ( superclass.getKind() == TypeKind.DECLARED ) {
|
||||||
|
final DeclaredType declaredType = (DeclaredType) superclass;
|
||||||
|
findSessionGetter( (TypeElement) declaredType.asElement() );
|
||||||
|
}
|
||||||
|
for ( TypeMirror superinterface : type.getInterfaces() ) {
|
||||||
|
if ( superinterface.getKind() == TypeKind.DECLARED ) {
|
||||||
|
final DeclaredType declaredType = (DeclaredType) superinterface;
|
||||||
|
findSessionGetter( (TypeElement) declaredType.asElement() );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue