[hibernate-commits] Hibernate SVN: r13937 - core/trunk/core/src/main/java/org/hibernate/engine/loading.

hibernate-commits at lists.jboss.org hibernate-commits at lists.jboss.org
Sun Aug 19 19:09:11 EDT 2007


Author: gbadner
Date: 2007-08-19 19:09:11 -0400 (Sun, 19 Aug 2007)
New Revision: 13937

Modified:
   core/trunk/core/src/main/java/org/hibernate/engine/loading/CollectionLoadContext.java
   core/trunk/core/src/main/java/org/hibernate/engine/loading/LoadContexts.java
Log:
HHH-2795 : CollectionLoadContext processing for empty collections


Modified: core/trunk/core/src/main/java/org/hibernate/engine/loading/CollectionLoadContext.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/engine/loading/CollectionLoadContext.java	2007-08-19 23:06:39 UTC (rev 13936)
+++ core/trunk/core/src/main/java/org/hibernate/engine/loading/CollectionLoadContext.java	2007-08-19 23:09:11 UTC (rev 13937)
@@ -152,7 +152,7 @@
 	public void endLoadingCollections(CollectionPersister persister) {
 		SessionImplementor session = getLoadContext().getPersistenceContext().getSession();
 		if ( !loadContexts.hasLoadingCollectionEntries()
-				|| localLoadingCollectionKeys.isEmpty() ) {
+				&& localLoadingCollectionKeys.isEmpty() ) {
 			return;
 		}
 

Modified: core/trunk/core/src/main/java/org/hibernate/engine/loading/LoadContexts.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/engine/loading/LoadContexts.java	2007-08-19 23:06:39 UTC (rev 13936)
+++ core/trunk/core/src/main/java/org/hibernate/engine/loading/LoadContexts.java	2007-08-19 23:09:11 UTC (rev 13937)
@@ -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() );
 	}
 
@@ -186,9 +197,6 @@
 		}
 	}
 
-
-
-
 	// loading collection xrefs ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 	/**
@@ -228,7 +236,7 @@
 	 * @param key The key of the collection we are done processing.
 	 */
 	void unregisterLoadingCollectionXRef(CollectionKey key) {
-		if ( !hasLoadingCollectionEntries() ) {
+		if ( !hasRegisteredLoadingCollectionEntries() ) {
 			return;
 		}
 		xrefLoadingCollectionEntries.remove(key);




More information about the hibernate-commits mailing list