| When a mapped superclass gets enhanced before a subclassing entity, the entity does not get enhanced itself. An entity does get enhanced if it comes before the mapped superclass. Find attached a sample project that reproduces this behaviour. Both AEntity and CEntity subclass BSuperclass. AEntity gets enhanced, CEntity does not. I guess this is due to this check in org.hibernate.bytecode.enhance.spi.Enhancer
if ( PersistentAttributesHelper.isAssignable( managedCtClass, Managed.class.getName() ) ) {
log.debugf( "Skipping enhancement of [%s]: already enhanced", managedCtClass.getName() );
return;
}
After the mapped superclass has itself been enhanced (it then implements Managed), the entity does also already implement that, despite not having been enhanced itself. |