From 3305af5fe87204c1edd6f3ddc706f972677648dd Mon Sep 17 00:00:00 2001 From: Steve Ebersole Date: Fri, 26 Oct 2012 14:32:05 -0500 Subject: [PATCH] HHH-1775 - collection batch fetching --- .../engine/internal/StatefulPersistenceContext.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/engine/internal/StatefulPersistenceContext.java b/hibernate-core/src/main/java/org/hibernate/engine/internal/StatefulPersistenceContext.java index f230b7ea45..065f354bb2 100644 --- a/hibernate-core/src/main/java/org/hibernate/engine/internal/StatefulPersistenceContext.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/internal/StatefulPersistenceContext.java @@ -896,8 +896,8 @@ public class StatefulPersistenceContext implements PersistenceContext { public void addUninitializedCollection(CollectionPersister persister, PersistentCollection collection, Serializable id) { CollectionEntry ce = new CollectionEntry(collection, persister, id, flushing); addCollection(collection, ce, id); - if (persister.getBatchSize() > 1) { - batchFetchQueue.addBatchLoadableCollection(collection, ce); + if ( persister.getBatchSize() > 1 ) { + getBatchFetchQueue().addBatchLoadableCollection( collection, ce ); } } @@ -908,6 +908,9 @@ public class StatefulPersistenceContext implements PersistenceContext { public void addUninitializedDetachedCollection(CollectionPersister persister, PersistentCollection collection) { CollectionEntry ce = new CollectionEntry( persister, collection.getKey() ); addCollection( collection, ce, collection.getKey() ); + if ( persister.getBatchSize() > 1 ) { + getBatchFetchQueue().addBatchLoadableCollection( collection, ce ); + } } /**