private Object[] getRow(
		final Tuple resultset,
		final OgmEntityPersister[] persisters,
		final org.hibernate.engine.spi.EntityKey[] keys,
		final Object optionalObject,
		final org.hibernate.engine.spi.EntityKey optionalObjectKey,
		final LockMode[] lockModes,
		final List hydratedObjects,
		final SharedSessionContractImplementor session)
	throws HibernateException {
		if ( keys.length > 1 ) {
			throw new NotYetImplementedException( "Loading involving several entities in one result set is not yet supported in OGM" );
		}

		final int cols = persisters.length;

		if ( log.isDebugEnabled() ) {
			log.debug(
					"result row: " +
					StringHelper.toString( keys )
				);
		}

		final Object[] rowResults = new Object[cols];

		for ( int i = 0; i < cols; i++ ) {

			Object object = null;
			org.hibernate.engine.spi.EntityKey key = keys[i];

			if ( keys[i] == null ) {
				//do nothing
			}
			else {
				//If the object is already loaded, return the loaded one
				object = session.getEntityUsingInterceptor( key );
				if ( object != null ) {
					//its already loaded so don't need to hydrate it
					instanceAlreadyLoaded(
							resultset,
							i,
							persisters[i],
							key,
							object,
							lockModes[i],
							session
						);
				}
				else {
					object = instanceNotYetLoaded(
							resultset,
							i,
							persisters[i],
							null, //We don't support rowId descriptors[i].getRowIdAlias(),
							key,
							lockModes[i],
							optionalObjectKey,
							optionalObject,
							hydratedObjects,
							session
						);
				}

			}

			rowResults[i] = object;

		}

		return rowResults;
	}
private Object [ ] getRow ( final Tuple resultset , final OgmEntityPersister [ ] persisters , final org . hibernate . engine . spi . EntityKey [ ] keys , final Object optionalObject , final org . hibernate . engine . spi . EntityKey optionalObjectKey , final LockMode [ ] lockModes , final List hydratedObjects , final SharedSessionContractImplementor session ) throws HibernateException { if ( keys . length > 1 ) { throw new NotYetImplementedException ( "Loading involving several entities in one result set is not yet supported in OGM" ) ; } final int cols = persisters . length ; if ( log . isDebugEnabled ( ) ) { log . debug ( "result row: " + StringHelper . toString ( keys ) ) ; } final Object [ ] rowResults = new Object [ cols ] ; for ( int i = 0 ; i < cols ; i ++ ) { Object object = null ; org . hibernate . engine . spi . EntityKey key = keys [ i ] ; if ( keys [ i ] == null ) { } else { object = session . getEntityUsingInterceptor ( key ) ; if ( object != null ) { instanceAlreadyLoaded ( resultset , i , persisters [ i ] , key , object , lockModes [ i ] , session ) ; } else { object = instanceNotYetLoaded ( resultset , i , persisters [ i ] , null , key , lockModes [ i ] , optionalObjectKey , optionalObject , hydratedObjects , session ) ; } } rowResults [ i ] = object ; } return rowResults ; }
Resolve any IDs for currently loaded objects, duplications within the
<tt>ResultSet</tt>, etc. Instantiate empty objects to be initialized from the
<tt>ResultSet</tt>. Return an array of objects (a row of results) and an
array of booleans (by side-effect) that determine whether the corresponding
object should be initialized.

Copied from Loader#getRow