Bug 319902 Internal API Usage of the ODA framework components
data/org.eclipse.birt.report.data.oda.jdbc.dbprofile.ui/src/org/eclipse/birt/report/data/oda/jdbc/dbprofile/ui/internal/sqb/SQLQueryUtility.java
sortKeyHint.setSortDirection( SortDirectionType.DESCENDING );
        int nullOrderingType = orderBySpec.getNullOrderingOption().getValue();
        if( nullOrderingType == NullOrderingType.NULLS_FIRST )
            sortKeyHint.setNullValueOrdering( org.eclipse.datatools.connectivity.oda.design.NullOrderingType.NULLS_FIRST );
        else if( nullOrderingType == NullOrderingType.NULLS_LAST )
            sortKeyHint.setNullValueOrdering( org.eclipse.datatools.connectivity.oda.design.NullOrderingType.NULLS_LAST );
        return sortKeyHint;
    }
    
    private static String getColumnReferenceName( ResultColumn resultColumn )
    {
        if( resultColumn == null )
            return null;
        
        if( resultColumn.getName() != null )   
            return resultColumn.getName();
        
        QueryValueExpression valueExpr = resultColumn.getValueExpr();
        if( valueExpr == null )
            return null;
        if( ! (valueExpr instanceof ValueExpressionColumn) )
            return valueExpr.getSQL();
        
        return valueExpr.getName();
    }
 
    private static String getColumnReferenceName( QueryValueExpression valueExpr, final QuerySelectStatement selectStmt )
    {
        if( valueExpr == null )
            return null;