return new SortSpec( sortKeyIndexes, sortAscending );
return new SortSpec( sortKeyIndexes, sortKeyColumns, sortAscending );
	public SortSpec getSortSpec( ) throws DataException	{		assert groupDefs != null;		// Create an array of column indexes. We first sort by Group keys, then		// sort keys		int groupCount = 0;		int sortCount = 0;		for ( int i = 0; i < groupDefs.length; i++ )		{			// When group column is rowid, sort on it should not			// take effect.			if ( groupDefs[i].getColumnIndex( ) >= 0 )			{				groupCount++;			}		}		if ( query.getOrdering( ) != null )		{			sortCount = query.getOrdering( ).length;		}		int[] sortKeyIndexes = new int[groupCount + sortCount];		boolean[] sortAscending = new boolean[groupCount + sortCount];		for ( int i = 0; i < groupCount; i++ )		{			int index = groupDefs[i].getColumnIndex( );			if ( index >= 0 )			{				sortKeyIndexes[i] = groupDefs[i].getColumnIndex( );				sortAscending[i] = groupDefs[i].getGroupSpec( )						.getSortDirection( ) != IQuery.GroupSpec.SORT_DESC;			}		}		for ( int i = 0; i < sortCount; i++ )		{			int keyIndex = query.getOrdering( )[i].getIndex( );			String keyName = query.getOrdering( )[i].getField( );			// If sort key name exist (not null) then depend on key name, else			// depend on key index			if ( keyName != null )				keyIndex = rsMeta.getFieldIndex( keyName );			if ( keyIndex < 1 || keyIndex > rsMeta.getFieldCount( ) )				// Invalid sort key name				throw new DataException( ResourceConstants.INVALID_KEY_COLUMN,						keyName );			sortKeyIndexes[groupCount + i] = keyIndex;			sortAscending[groupCount + i] = query.getOrdering( )[i].isAscendingOrder( );		}		return new SortSpec( sortKeyIndexes, sortAscending );	}