Пример #1
0
        private QlExpression PushOrderByIn(Expression result, EJournalExpressionType expr, QlExpression column,
                                           QlToken toQlToken)
        {
            var take = result as SliceExpression;

            if (take == null)
            {
                return(new OrderExpression(result, expr, column, toQlToken));
            }
            return(new SliceExpression(PushOrderByIn(take.Body, expr, column, toQlToken), take.Operation, take.Count));
        }
Пример #2
0
        public void ApplyLinq(EJournalExpressionType operation, int count)
        {
            if (operation == EJournalExpressionType.Skip && count == 0)
            {
                return;
            }
            if (operation == EJournalExpressionType.Take && count == int.MaxValue)
            {
                return;
            }
            if (operation == EJournalExpressionType.Take && count == 0)
            {
                // No rows to be selected.
                MakeEmpty();
                return;
            }

            _directExpressions.Add(new DirectExpression(operation, count));
        }
Пример #3
0
 public QueryRowsResult(IEnumerable <long> rowids, EJournalExpressionType postExpression)
     : this()
 {
     PostExpression = postExpression;
     Rowids         = rowids;
 }
Пример #4
0
 public SliceExpression(Expression body, EJournalExpressionType operation, Expression count, QlToken token)
     : base(body, operation, token)
 {
     Count = count;
 }
Пример #5
0
 public DirectExpression(EJournalExpressionType expression, int count)
     : this()
 {
     Expression = expression;
     Count      = count;
 }
Пример #6
0
 public DirectExpression(EJournalExpressionType expression, IColumnMetadata column)
     : this()
 {
     Expression = expression;
     Column     = column;
 }
Пример #7
0
 public DirectExpression(EJournalExpressionType expression)
     : this()
 {
     Expression = expression;
 }
Пример #8
0
 public void ApplyOrderBy(IColumnMetadata column, EJournalExpressionType expression)
 {
     _directExpressions.Add(new DirectExpression(expression, column));
 }
Пример #9
0
 public void ApplyLinq(EJournalExpressionType operation)
 {
     _directExpressions.Add(new DirectExpression(operation));
 }
Пример #10
0
        private Expression BindPostResult(Type resultType, ReadOnlyCollection <Expression> arguments, EJournalExpressionType expressionType)
        {
            if (resultType != typeof(T))
            {
                throw QueryExceptionExtensions.NotSupported("{0} operation canonly be bound to JournalQueryable of {1} but used on {2}",
                                                            expressionType, typeof(T).Name, resultType);
            }
            var source = arguments[0];

            if (arguments.Count > 1)
            {
                var lambda = GetLambda(arguments[1]);
                return(new PostResultExpression(new FilterExpression(Visit(lambda.Body), Visit(source)), expressionType));
            }
            return(new PostResultExpression(Visit(source), expressionType));
        }
Пример #11
0
 private Expression BindOrderBy(Expression source, LambdaExpression lambdaExpression, EJournalExpressionType direction)
 {
     return(new OrderExpression(Visit(source), direction, lambdaExpression));
 }
Пример #12
0
 public PostResultExpression(Expression body, EJournalExpressionType operation)
     : base(QlToken.QUERIABLE_TOKEN)
 {
     _body      = body;
     _operation = operation;
 }
Пример #13
0
 public PostResultExpression(Expression body, EJournalExpressionType operation, QlToken token)
     : base(token)
 {
     _body      = body;
     _operation = operation;
 }
Пример #14
0
 public OrderExpression(Expression body, EJournalExpressionType operation, LambdaExpression predicate)
     : base(body, operation)
 {
     _predicate = predicate;
 }
Пример #15
0
 public OrderExpression(Expression body, EJournalExpressionType operation, Expression predicate, QlToken token)
     : base(body, operation, token)
 {
     _predicate = predicate;
 }
Пример #16
0
 public OrderExpression(Expression body, EJournalExpressionType operation)
     : base(body, operation)
 {
 }