// in a temp collection. the temp collection is then used to "drive"
// the #endRead processing.
List matches = null;
Iterator iter = localLoadingCollectionKeys.iterator();
while ( iter.hasNext() ) {
final CollectionKey collectionKey = (CollectionKey) iter.next();
final LoadingCollectionEntry lce = loadContexts.locateLoadingCollectionEntry( collectionKey );
if (lce == null) LOG.loadingCollectionKeyNotFound(collectionKey);
else if ( lce.getResultSet() == resultSet && lce.getPersister() == persister ) {
if ( matches == null ) {
matches = new ArrayList();
}
matches.add( lce );
if ( lce.getCollection().getOwner() == null ) {
session.getPersistenceContext().addUnownedCollection(
new CollectionKey(
persister,
lce.getKey(),
persister.getOwnerEntityPersister().getEntityMetamodel().getEntityMode()
),
lce.getCollection()