HHH-13455 - Enabling Enhancement as a Proxy causes IllegalStateException when using Javassist

This commit is contained in:
Andrea Boriero 2019-06-25 13:33:26 +01:00
parent db2e8382d5
commit beac486533
2 changed files with 9 additions and 1 deletions

View File

@ -105,7 +105,10 @@ public class PersistentAttributesEnhancer extends EnhancerImpl {
try {
CtClass managedCtSuperclass = managedCtClass.getSuperclass();
if ( !enhancementContext.isMappedSuperclassClass( managedCtSuperclass ) ) {
if ( enhancementContext.isEntityClass( managedCtSuperclass ) ) {
return Collections.emptyList();
}
else if ( !enhancementContext.isMappedSuperclassClass( managedCtSuperclass ) ) {
return collectInheritPersistentFields( managedCtSuperclass );
}
log.debugf( "Found @MappedSuperclass %s to collectPersistenceFields", managedCtSuperclass.getName() );

View File

@ -24,4 +24,9 @@ public class UnloadedCtField implements UnloadedField {
public boolean hasAnnotation(Class<? extends Annotation> annotationType) {
return ctField.hasAnnotation( annotationType );
}
@Override
public String toString() {
return this.ctField.toString();
}
}