diff --git a/hibernate-core/src/main/java/org/hibernate/bytecode/enhance/internal/javassist/PersistentAttributesEnhancer.java b/hibernate-core/src/main/java/org/hibernate/bytecode/enhance/internal/javassist/PersistentAttributesEnhancer.java index 9bba897b91..e33d8a47f2 100644 --- a/hibernate-core/src/main/java/org/hibernate/bytecode/enhance/internal/javassist/PersistentAttributesEnhancer.java +++ b/hibernate-core/src/main/java/org/hibernate/bytecode/enhance/internal/javassist/PersistentAttributesEnhancer.java @@ -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() ); diff --git a/hibernate-core/src/main/java/org/hibernate/bytecode/enhance/internal/javassist/UnloadedCtField.java b/hibernate-core/src/main/java/org/hibernate/bytecode/enhance/internal/javassist/UnloadedCtField.java index 3b61833a40..1c04d176de 100644 --- a/hibernate-core/src/main/java/org/hibernate/bytecode/enhance/internal/javassist/UnloadedCtField.java +++ b/hibernate-core/src/main/java/org/hibernate/bytecode/enhance/internal/javassist/UnloadedCtField.java @@ -24,4 +24,9 @@ public class UnloadedCtField implements UnloadedField { public boolean hasAnnotation(Class annotationType) { return ctField.hasAnnotation( annotationType ); } + + @Override + public String toString() { + return this.ctField.toString(); + } }