if ( !uniqueName.equals( resultSetColumn.getColumnName( ) ) ) { updateModelColumn( dataSetHandle, columnDef ); } ColumnHintHandle columnHint = findColumnHint( dataSetHandle, uniqueName ); if ( columnHint != null ) { columnDef.setAlias( columnHint.getAlias( ) ); columnDef.setLableName( columnHint.getDisplayName( ) ); }
	public static IResultMetaData retrieveResultMetaData(			DataSetHandle dataSetHandle ) throws BirtException	{		List resultSetList = null;		if ( dataSetHandle instanceof OdaDataSetHandle )		{			resultSetList = (List) dataSetHandle.getProperty( OdaDataSetHandle.RESULT_SET_PROP );			if ( dataSetHandle.getPropertyHandle( DataSetHandle.RESULT_SET_HINTS_PROP ) != null )				dataSetHandle.getPropertyHandle( DataSetHandle.RESULT_SET_HINTS_PROP )						.clearValue( );		}		else		{			return null;		}		List computedList = (List) dataSetHandle.getProperty( OdaDataSetHandle.COMPUTED_COLUMNS_PROP );		List columnMeta = new ArrayList( );		ResultSetColumnDefinition columnDef;		int index = 0;		// populate result set columns		if ( resultSetList != null )		{			ResultSetColumn resultSetColumn;			HashSet orgColumnNameSet = new HashSet( );			HashSet uniqueColumnNameSet = new HashSet( );			for ( int n = 0; n < resultSetList.size( ); n++ )			{				orgColumnNameSet.add( ( (ResultSetColumn) resultSetList.get( n ) ).getColumnName( ) );			}			for ( int i = 0; i < resultSetList.size( ); i++ )			{				resultSetColumn = (ResultSetColumn) resultSetList.get( i );				String uniqueName = getUniqueName( orgColumnNameSet,						uniqueColumnNameSet,						resultSetColumn.getColumnName( ),						i );				columnDef = new ResultSetColumnDefinition( uniqueName );				uniqueColumnNameSet.add( uniqueName );				columnDef.setDataTypeName( resultSetColumn.getDataType( ) );				columnDef.setDataType( ModelAdapter.adaptModelDataType( resultSetColumn.getDataType( ) ) );				columnDef.setColumnPosition( resultSetColumn.getPosition( )						.intValue( ) );				if ( !uniqueName.equals( resultSetColumn.getColumnName( ) ) )				{					updateModelColumn( dataSetHandle, columnDef );				}				ColumnHintHandle columnHint = findColumnHint( dataSetHandle,						uniqueName );				if ( columnHint != null )				{					columnDef.setAlias( columnHint.getAlias( ) );					columnDef.setLableName( columnHint.getDisplayName( ) );				}				columnDef.setComputedColumn( false );				columnMeta.add( columnDef );				index++;			}			// populate computed columns			if ( computedList != null )			{				ComputedColumn computedColumn;				Iterator computedColumnIterator = computedList.iterator( );				while ( computedColumnIterator.hasNext( ) )				{					computedColumn = (ComputedColumn) computedColumnIterator.next( );					columnDef = new ResultSetColumnDefinition( computedColumn.getName( ) );					columnDef.setDataTypeName( computedColumn.getDataType( ) );					columnDef.setDataType( ModelAdapter.adaptModelDataType( computedColumn.getDataType( ) ) );					if ( findColumnHint( dataSetHandle,							computedColumn.getName( ) ) != null )					{						ColumnHintHandle columnHint = findColumnHint( dataSetHandle,								computedColumn.getName( ) );						columnDef.setAlias( columnHint.getAlias( ) );						columnDef.setLableName( columnHint.getDisplayName( ) );					}					columnDef.setComputedColumn( true );					columnMeta.add( columnDef );					index++;				}			}			return new ResultMetaData2( columnMeta );		}		return null;	}