Author: gbadner
Date: 2007-08-19 19:06:39 -0400 (Sun, 19 Aug 2007)
New Revision: 13936
Modified:
core/branches/Branch_3_2/src/org/hibernate/engine/loading/CollectionLoadContext.java
core/branches/Branch_3_2/src/org/hibernate/engine/loading/LoadContexts.java
Log:
HHH-2795 : CollectionLoadContext processing for empty collections
Modified:
core/branches/Branch_3_2/src/org/hibernate/engine/loading/CollectionLoadContext.java
===================================================================
---
core/branches/Branch_3_2/src/org/hibernate/engine/loading/CollectionLoadContext.java 2007-08-18
13:48:50 UTC (rev 13935)
+++
core/branches/Branch_3_2/src/org/hibernate/engine/loading/CollectionLoadContext.java 2007-08-19
23:06:39 UTC (rev 13936)
@@ -153,7 +153,7 @@
public void endLoadingCollections(CollectionPersister persister) {
SessionImplementor session = getLoadContext().getPersistenceContext().getSession();
if ( !loadContexts.hasLoadingCollectionEntries()
- || localLoadingCollectionKeys.isEmpty() ) {
+ && localLoadingCollectionKeys.isEmpty() ) {
return;
}
Modified: core/branches/Branch_3_2/src/org/hibernate/engine/loading/LoadContexts.java
===================================================================
--- core/branches/Branch_3_2/src/org/hibernate/engine/loading/LoadContexts.java 2007-08-18
13:48:50 UTC (rev 13935)
+++ core/branches/Branch_3_2/src/org/hibernate/engine/loading/LoadContexts.java 2007-08-19
23:06:39 UTC (rev 13936)
@@ -132,6 +132,17 @@
* false otherwise.
*/
public boolean hasLoadingCollectionEntries() {
+ return ( collectionLoadContexts != null && !collectionLoadContexts.isEmpty()
);
+ }
+
+ /**
+ * Do we currently have any registered internal entries corresponding to loading
+ * collections?
+ *
+ * @return True if we currently hold state pertaining to a registered loading
collections;
+ * false otherwise.
+ */
+ public boolean hasRegisteredLoadingCollectionEntries() {
return ( xrefLoadingCollectionEntries != null &&
!xrefLoadingCollectionEntries.isEmpty() );
}
@@ -228,7 +239,7 @@
* @param key The key of the collection we are done processing.
*/
void unregisterLoadingCollectionXRef(CollectionKey key) {
- if ( !hasLoadingCollectionEntries() ) {
+ if ( !hasRegisteredLoadingCollectionEntries() ) {
return;
}
xrefLoadingCollectionEntries.remove(key);
Show replies by date