コード例 #1
0
        private static int Compare(OrderByColumn c, RowHolder x, RowHolder y)
        {
            IComparable left  = QueryProcessingAccessors.MetadataColumnRowsetHolderFetcher(c.column, x);
            IComparable right = QueryProcessingAccessors.MetadataColumnRowsetHolderFetcher(c.column, y);

            return((c.direction == OrderByColumn.Direction.Asc) ? left.CompareTo(right) : right.CompareTo(left));
        }
コード例 #2
0
ファイル: OrderByOpBuilder.cs プロジェクト: n0vakovic/bgdb
        private OrderByColumn[] GetOrderByColumns(MetadataColumn[] columns, FSharpList <Tuple <string, Sql.dir> > orderBy)
        {
            OrderByColumn[] orderByColumns = new OrderByColumn[orderBy.Length];
            for (int i = 0; i < orderBy.Length; ++i)
            {
                MetadataColumn          column    = QueryProcessingAccessors.GetMetadataColumn(orderBy[i].Item1, columns);
                OrderByColumn.Direction direction = orderBy[i].Item2 == Sql.dir.Asc ? OrderByColumn.Direction.Asc : OrderByColumn.Direction.Desc;

                orderByColumns[i] = new OrderByColumn(column, direction);
            }

            return(orderByColumns);
        }