Пример #1
0
        public void interpretQuery(Context context, IQueryBuilder builder)
        {
            AttributeDeclaration decl = left.CheckAttribute(context);

            if (decl == null || !decl.Storable)
            {
                throw new SyntaxError("Unable to interpret predicate");
            }
            IValue        value = right.interpret(context);
            AttributeInfo info  = decl.getAttributeInfo();

            if (value is IInstance)
            {
                value = ((IInstance)value).GetMemberValue(context, "dbId", false);
            }
            MatchOp matchOp = getMatchOp();

            builder.Verify(info, matchOp, value == null ? null : value.GetStorableData());
            switch (oper)
            {
            case CmpOp.GTE:
            case CmpOp.LTE:
                builder.Not();
                break;
            }
        }
Пример #2
0
        public void interpretQuery(Context context, IQueryBuilder builder)
        {
            AttributeDeclaration decl = left.CheckAttribute(context);

            if (decl == null ||   !decl.Storable)
            {
                throw new SyntaxError("Unable to interpret predicate");
            }
            IValue value = right.interpret(context);

            if (value is IInstance)
            {
                value = ((IInstance)value).GetMemberValue(context, "dbId", false);
            }
            AttributeInfo info  = decl.getAttributeInfo();
            Object        data  = value == null ? null : value.GetStorableData();
            MatchOp       match = GetMatchOp();

            builder.Verify <Object>(info, match, data);
            if (oper == EqOp.NOT_EQUALS || oper == EqOp.IS_NOT || oper == EqOp.NOT_CONTAINS)
            {
                builder.Not();
            }
        }
Пример #3
0
        public void interpretQuery(Context context, IQueryBuilder builder)
        {
            AttributeDeclaration decl = left.CheckAttribute(context);

            if (decl == null || !decl.Storable)
            {
                throw new SyntaxError("Unable to interpret predicate");
            }
            IValue  value   = right.interpret(context);
            MatchOp matchOp = getMatchOp(context, decl.getIType(), value.GetIType(), this.oper, false);

            if (value is IInstance)
            {
                value = ((IInstance)value).GetMemberValue(context, "dbId", false);
            }
            AttributeInfo info = decl.getAttributeInfo();
            Object        data = value == null ? null : value.GetStorableData();

            builder.Verify <Object>(info, matchOp, data);
            if (oper.ToString().StartsWith("NOT_"))
            {
                builder.Not();
            }
        }
Пример #4
0
 public void Verify <T>(AttributeInfo info, MatchOp match, T fieldValue)
 {
     predicates.Push(new MatchesPredicate <T>(info, match, fieldValue));
 }
Пример #5
0
			/// <summary>
			/// Constructor for non-root node
			/// </summary>
			internal MatchTask(MatchTask<P_IN, P_OUT> parent, Spliterator<P_IN> spliterator) : base(parent, spliterator)
			{
				this.Op = parent.Op;
			}
Пример #6
0
			/// <summary>
			/// Constructor for root node
			/// </summary>
			internal MatchTask(MatchOp<P_OUT> op, PipelineHelper<P_OUT> helper, Spliterator<P_IN> spliterator) : base(helper, spliterator)
			{
				this.Op = op;
			}
Пример #7
0
 public MatchesPredicate(AttributeInfo info, MatchOp match, T value)
 {
     this.info  = info;
     this.match = match;
     this.value = value;
 }
Пример #8
0
 public void Verify <T>(AttributeInfo info, MatchOp match, T fieldValue)
 {
     query.Verify(info, match, fieldValue);
 }