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

(cherry picked from commit beac486533)
This commit is contained in:
Andrea Boriero 2019-06-25 13:33:26 +01:00 committed by Gail Badner
parent 1ff9d19d8e
commit c211c61d86
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();
}
}