HHH-12486 - Avoid unnecessary exceptions during entity persister lookup during query compilation
This commit is contained in:
parent
5803ad5839
commit
2de4277c34
|
@ -138,11 +138,9 @@ public class SessionFactoryHelper {
|
||||||
*/
|
*/
|
||||||
public EntityPersister findEntityPersisterByName(String name) throws MappingException {
|
public EntityPersister findEntityPersisterByName(String name) throws MappingException {
|
||||||
// First, try to get the persister using the given name directly.
|
// First, try to get the persister using the given name directly.
|
||||||
try {
|
EntityPersister persister = sfi.getMetamodel().entityPersisters().get( name );
|
||||||
return sfi.getMetamodel().entityPersister( name );
|
if ( persister != null ) {
|
||||||
}
|
return persister;
|
||||||
catch ( MappingException ignore ) {
|
|
||||||
// unable to locate it using this name
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// If that didn't work, try using the 'import' name.
|
// If that didn't work, try using the 'import' name.
|
||||||
|
|
Loading…
Reference in New Issue