Similar to HHH-10977 but in this case an entity superclass subclass is incorrectly assumed to be enhanced when the entity subclass superclass has been enhanced already.
Suggested fix is to check for the Managed interface on the class only instead of on the class and its superclasses:
{{ private boolean alreadyEnhanced(CtClass managedCtClass) { try { String targetClassName = Managed.class.getName(); for (CtClass managedCtClassInterface: managedCtClass.getInterfaces()) { if ( PersistentAttributesHelper.isAssignable( managedCtClassInterface, targetClassName ) ) { return true; } } } catch (NotFoundException e) { // keep going } return false; } }} |
|