diff --git a/hibernate-core/src/main/java/org/hibernate/event/internal/DefaultLoadEventListener.java b/hibernate-core/src/main/java/org/hibernate/event/internal/DefaultLoadEventListener.java index 323a9e6c24..85237005ad 100644 --- a/hibernate-core/src/main/java/org/hibernate/event/internal/DefaultLoadEventListener.java +++ b/hibernate-core/src/main/java/org/hibernate/event/internal/DefaultLoadEventListener.java @@ -313,8 +313,10 @@ public class DefaultLoadEventListener extends AbstractLockUpgradeEventListener i } } - // 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