HHH-2795 : CollectionLoadContext processing for empty collections
git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@13937 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
parent
7955c1a75d
commit
d2d2c1c13e
|
@ -152,7 +152,7 @@ public class CollectionLoadContext {
|
|||
public void endLoadingCollections(CollectionPersister persister) {
|
||||
SessionImplementor session = getLoadContext().getPersistenceContext().getSession();
|
||||
if ( !loadContexts.hasLoadingCollectionEntries()
|
||||
|| localLoadingCollectionKeys.isEmpty() ) {
|
||||
&& localLoadingCollectionKeys.isEmpty() ) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -132,6 +132,17 @@ public class LoadContexts {
|
|||
* 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 @@ public class LoadContexts {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// loading collection xrefs ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
/**
|
||||
|
@ -228,7 +236,7 @@ public class LoadContexts {
|
|||
* @param key The key of the collection we are done processing.
|
||||
*/
|
||||
void unregisterLoadingCollectionXRef(CollectionKey key) {
|
||||
if ( !hasLoadingCollectionEntries() ) {
|
||||
if ( !hasRegisteredLoadingCollectionEntries() ) {
|
||||
return;
|
||||
}
|
||||
xrefLoadingCollectionEntries.remove(key);
|
||||
|
|
Loading…
Reference in New Issue