HHH-12485 - Avoid unnecessary exceptions during import class name lookup of metamodel

(cherry picked from commit 2bf323f01f)
This commit is contained in:
Christian Beikov 2018-04-13 15:42:07 +02:00 committed by Steve Ebersole
parent 436500dc13
commit ba70924073
1 changed files with 5 additions and 0 deletions

View File

@ -70,6 +70,7 @@ public class MetamodelImpl implements MetamodelImplementor, Serializable {
// todo : Integrate EntityManagerLogger into CoreMessageLogger
private static final EntityManagerMessageLogger log = HEMLogging.messageLogger( MetamodelImpl.class );
private static final Object ENTITY_NAME_RESOLVER_MAP_VALUE = new Object();
private static final String INVALID_IMPORT = "";
private final SessionFactoryImplementor sessionFactory;
@ -522,9 +523,13 @@ public class MetamodelImpl implements MetamodelImplementor, Serializable {
return className;
}
catch ( ClassLoadingException cnfe ) {
imports.put( className, INVALID_IMPORT );
return null;
}
}
else if ( result == INVALID_IMPORT ) {
return null;
}
else {
return result;
}