Rebase main -> 7.0

fixups
This commit is contained in:
Steve Ebersole 2024-07-22 10:56:11 -05:00
parent 865f14a6fb
commit 4ff20e6114
2 changed files with 7 additions and 23 deletions

View File

@ -228,15 +228,13 @@ public class AnnotationMetadataSourceProcessorImpl implements MetadataSourceProc
private void insertMappedSuperclasses(LinkedHashSet<ClassDetails> original, LinkedHashSet<ClassDetails> copy) {
final boolean debug = log.isDebugEnabled();
LinkedHashSet<XClass> orderedClasses = CollectionHelper.linkedSetOfSize( classes.size() * 2 );
List<XClass> clazzHierarchy = new ArrayList<>();
for ( ClassDetails clazz : classes ) {
for ( ClassDetails clazz : original ) {
if ( clazz.isInterface() ) {
if ( clazz.hasDirectAnnotationUsage( Entity.class ) ) {
throw new MappingException( "Only classes (not interfaces) may be mapped as @Entity : " + clazz.getName() );
}
}
if ( clazz.hasDirectAnnotationUsage( MappedSuperclass.class ) ) {
if ( debug ) {
log.debugf(
@ -246,22 +244,14 @@ public class AnnotationMetadataSourceProcessorImpl implements MetadataSourceProc
}
}
else {
if ( orderedClasses.contains( clazz ) ) {
continue;
}
clazzHierarchy.clear();
clazzHierarchy.add( clazz );
copy.add( clazz );
ClassDetails superClass = clazz.getSuperClass();
while ( superClass != null
&& !Object.class.getName().equals( superClass.getName() ) ) {
&& !Object.class.getName().equals( superClass.getName() )
&& !copy.contains( superClass ) ) {
if ( superClass.hasDirectAnnotationUsage( Entity.class )
|| superClass.hasDirectAnnotationUsage( MappedSuperclass.class ) ) {
if ( orderedClasses.contains( superClass ) ) {
break;
}
clazzHierarchy.add( superClass );
copy.add( superClass );
}
superClass = superClass.getSuperClass();
}
@ -277,9 +267,9 @@ public class AnnotationMetadataSourceProcessorImpl implements MetadataSourceProc
if ( !newList.contains( clazz ) ) {
newList.add( clazz );
}
copy.remove( clazz );
}
}
return new ArrayList<>( orderedClasses );
}
@Override

View File

@ -796,12 +796,6 @@ public abstract class MockSessionFactory
}
}
@Override
public <X> ManagedDomainType<X> managedType(String typeName) {
final String entityName = findEntityName( typeName );
return entityName == null ? null : entity( entityName );
}
@Override
public String qualifyImportableName(String queryName) {
if (isClassDefined(queryName)) {