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 31c396ddf7..126c7d684e 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 @@ -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