code: private void handleEmptyCollections(
  		final Serializable[] keys,
  		final ResultSet resultSetId,
  		final SharedSessionContractImplementor session) {
  
  		if ( keys != null ) {
  			// this is a collection initializer, so we must create a collection
  			// for each of the passed-in keys, to account for the possibility
  			// that the collection is empty and has no rows in the result set
  
  			CollectionPersister[] collectionPersisters = getCollectionPersisters();
  			for ( int j = 0; j < collectionPersisters.length; j++ ) {
  				for ( int i = 0; i < keys.length; i++ ) {
  					//handle empty collections
  
  					if ( log.isDebugEnabled() ) {
  						log.debug(
  								"result set contains (possibly empty) collection: " +
  								MessageHelper.collectionInfoString( collectionPersisters[j], keys[i], getFactory() )
  							);
  					}
  
  					session.getPersistenceContext()
  							.getLoadContexts()
  							.getCollectionLoadContext( resultSetId )
  							.getLoadingCollection( collectionPersisters[j], keys[i] );
  				}
  			}
  		}
  
  		// else this is not a collection initializer (and empty collections will
  		// be detected by looking for the owner's identifier in the result set)
  	}
docs: If this is a collection initializer, we need to tell the session that a collection
  is being initialized, to account for the possibility of the collection having
  no elements (hence no rows in the result set).
  
  @param keys the collection keys
  @param resultSetId the result set
  @param session the session