HHH-14499 Explicitly listing mapped classes which are @MappedSuperClass might break narrowing down of generics
This commit is contained in:
parent
394d6ab2d4
commit
9f22dafe17
|
@ -252,7 +252,7 @@ public class AnnotationMetadataSourceProcessorImpl implements MetadataSourceProc
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<XClass> orderAndFillHierarchy(List<XClass> original) {
|
private List<XClass> orderAndFillHierarchy(List<XClass> original) {
|
||||||
List<XClass> copy = new ArrayList<XClass>( original );
|
List<XClass> copy = new ArrayList<>( original.size() );
|
||||||
insertMappedSuperclasses( original, copy );
|
insertMappedSuperclasses( original, copy );
|
||||||
|
|
||||||
// order the hierarchy
|
// order the hierarchy
|
||||||
|
@ -266,7 +266,18 @@ public class AnnotationMetadataSourceProcessorImpl implements MetadataSourceProc
|
||||||
}
|
}
|
||||||
|
|
||||||
private void insertMappedSuperclasses(List<XClass> original, List<XClass> copy) {
|
private void insertMappedSuperclasses(List<XClass> original, List<XClass> copy) {
|
||||||
|
final boolean debug = log.isDebugEnabled();
|
||||||
for ( XClass clazz : original ) {
|
for ( XClass clazz : original ) {
|
||||||
|
if ( clazz.isAnnotationPresent( javax.persistence.MappedSuperclass.class ) ) {
|
||||||
|
if ( debug ) {
|
||||||
|
log.debugf(
|
||||||
|
"Skipping explicit MappedSuperclass %s, the class will be discovered analyzing the implementing class",
|
||||||
|
clazz
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
copy.add( clazz );
|
||||||
XClass superClass = clazz.getSuperclass();
|
XClass superClass = clazz.getSuperclass();
|
||||||
while ( superClass != null
|
while ( superClass != null
|
||||||
&& !reflectionManager.equals( superClass, Object.class )
|
&& !reflectionManager.equals( superClass, Object.class )
|
||||||
|
@ -279,6 +290,7 @@ public class AnnotationMetadataSourceProcessorImpl implements MetadataSourceProc
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void orderHierarchy(List<XClass> copy, List<XClass> newList, List<XClass> original, XClass clazz) {
|
private void orderHierarchy(List<XClass> copy, List<XClass> newList, List<XClass> original, XClass clazz) {
|
||||||
if ( clazz == null || reflectionManager.equals( clazz, Object.class ) ) {
|
if ( clazz == null || reflectionManager.equals( clazz, Object.class ) ) {
|
||||||
|
|
Loading…
Reference in New Issue