HHH-10981 - No need to add template methods for inherited persistent fields

This commit is contained in:
barreiro 2016-08-04 02:54:43 +01:00 committed by Andrea Boriero
parent e2641afb12
commit 20c2037529
2 changed files with 9 additions and 2 deletions

View File

@ -225,7 +225,11 @@ public class EntityEnhancer extends PersistentAttributesEnhancer {
}
// HHH-10646 Add fields inherited from @MappedSuperclass
collectionList.addAll( collectInheritCollectionFields( managedCtClass ) );
// HHH-10981 There is no need to do it for @MappedSuperclass
if ( !enhancementContext.isMappedSuperclassClass( managedCtClass ) ) {
collectionList.addAll( collectInheritCollectionFields( managedCtClass ) );
}
return collectionList;
}

View File

@ -91,7 +91,10 @@ public class PersistentAttributesEnhancer extends Enhancer {
}
}
// HHH-10646 Add fields inherited from @MappedSuperclass
persistentFieldList.addAll( collectInheritPersistentFields( managedCtClass ) );
// HHH-10981 There is no need to do it for @MappedSuperclass
if ( !enhancementContext.isMappedSuperclassClass( managedCtClass ) ) {
persistentFieldList.addAll( collectInheritPersistentFields( managedCtClass ) );
}
CtField[] orderedFields = enhancementContext.order( persistentFieldList.toArray( new CtField[0] ) );
log.debugf( "Persistent fields for entity %s: %s", managedCtClass.getName(), Arrays.toString( orderedFields ));