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 5d0d134df3
commit 6aebd26167
1 changed files with 4 additions and 2 deletions

View File

@ -292,8 +292,10 @@ public class DefaultLoadEventListener implements LoadEventListener {
}
}
// Potentially add a batch-fetch entry into the queue for this entity
persistenceContext.getBatchFetchQueue().addBatchLoadableEntityKey( keyToLoad );
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