@Override
	public Object[] getDatabaseSnapshot(Serializable id, SharedSessionContractImplementor session)
			throws HibernateException {

		if ( log.isTraceEnabled() ) {
			log.trace( "Getting current persistent state for: " + MessageHelper.infoString( this, id, getFactory() ) );
		}

		//snapshot is a Map in the end
		final Tuple resultset = getFreshTuple( EntityKeyBuilder.fromPersister( this, id, session ), session );

		//if there is no resulting row, return null
		if ( resultset == null || resultset.getSnapshot().isEmpty() ) {
			return null;
		}
		//otherwise return the "hydrated" state (ie. associations are not resolved)
		GridType[] types = gridPropertyTypes;
		Object[] values = new Object[types.length];
		boolean[] includeProperty = getPropertyUpdateability();
		for ( int i = 0; i < types.length; i++ ) {
			if ( includeProperty[i] ) {
				values[i] = types[i].hydrate( resultset, getPropertyAliases( "", i ), session, null ); //null owner ok??
			}
		}
		return values;
	}
@ Override public Object [ ] getDatabaseSnapshot ( Serializable id , SharedSessionContractImplementor session ) throws HibernateException { if ( log . isTraceEnabled ( ) ) { log . trace ( "Getting current persistent state for: " + MessageHelper . infoString ( this , id , getFactory ( ) ) ) ; } final Tuple resultset = getFreshTuple ( EntityKeyBuilder . fromPersister ( this , id , session ) , session ) ; if ( resultset == null || resultset . getSnapshot ( ) . isEmpty ( ) ) { return null ; } GridType [ ] types = gridPropertyTypes ; Object [ ] values = new Object [ types . length ] ; boolean [ ] includeProperty = getPropertyUpdateability ( ) ; for ( int i = 0 ; i < types . length ; i ++ ) { if ( includeProperty [ i ] ) { values [ i ] = types [ i ] . hydrate ( resultset , getPropertyAliases ( "" , i ) , session , null ) ; } } return values ; }
This snapshot is meant to be used when updating data.