HHH-11147 Avoid allocating a BatchFetchQueue if batching was not enabled

This commit is contained in:
Sanne Grinovero 2019-06-27 15:33:05 +01:00
parent d968b0a3a5
commit 4bd5ca85da
1 changed files with 4 additions and 2 deletions

View File

@ -313,8 +313,10 @@ public class DefaultLoadEventListener extends AbstractLockUpgradeEventListener i
}
}
// Potentially add a batch-fetch entry into the queue for this entity
if ( keyToLoad.isBatchLoadable() ) {
// Add a batch-fetch entry into the queue for this entity
persistenceContext.getBatchFetchQueue().addBatchLoadableEntityKey( keyToLoad );
}
// This is the crux of HHH-11147
// create the (uninitialized) entity instance - has only id set