Esempio n. 1
0
			public virtual void Visit(ComparisonExpression expression)
			{
				this.LoadQuery();
				this.Descend(this.FieldNames(expression.Left()));
				expression.Right().Accept(this.ComparisonEmitter());
				this.Constrain(expression.Op());
			}
Esempio n. 2
0
 public override bool Equals(object other)
 {
     if (this == other)
     {
         return(true);
     }
     if (other == null || GetType() != other.GetType())
     {
         return(false);
     }
     Db4objects.Db4o.NativeQueries.Expr.ComparisonExpression casted = (Db4objects.Db4o.NativeQueries.Expr.ComparisonExpression
                                                                       )other;
     return(_left.Equals(casted._left) && _right.Equals(casted._right) && _op.Equals(casted
                                                                                     ._op));
 }
Esempio n. 3
0
			public virtual void Visit(ComparisonExpression expression)
			{
				IQuery subQuery = Descend(expression.Left());
				ComparisonQueryGeneratingVisitor visitor = new ComparisonQueryGeneratingVisitor(_predicate
					, _classSource, _referenceResolver);
				expression.Right().Accept(visitor);
				_constraint = subQuery.Constrain(visitor.Value());
				ComparisonOperator op = expression.Op();
				if (op.Equals(ComparisonOperator.ValueEquality))
				{
					return;
				}
				if (op.Equals(ComparisonOperator.ReferenceEquality))
				{
					_constraint.Identity();
					return;
				}
				if (op.Equals(ComparisonOperator.Greater))
				{
					_constraint.Greater();
					return;
				}
				if (op.Equals(ComparisonOperator.Smaller))
				{
					_constraint.Smaller();
					return;
				}
				if (op.Equals(ComparisonOperator.Contains))
				{
					_constraint.Contains();
					return;
				}
				if (op.Equals(ComparisonOperator.StartsWith))
				{
					_constraint.StartsWith(true);
					return;
				}
				if (op.Equals(ComparisonOperator.EndsWith))
				{
					_constraint.EndsWith(true);
					return;
				}
				throw new Exception("Can't handle constraint: " + op);
			}
Esempio n. 4
0
 public virtual void Visit(ComparisonExpression expression)
 {
     expression.Left().Accept(this);
     expression.Right().Accept(this);
 }
 public void TestQueryWithEnumConstrain()
 {
     var expression = ExpressionFromMethod("MatchEnumConstrain");
     IExpression expected = new ComparisonExpression(
         NewFieldValue(CandidateFieldRoot.Instance, "_priority", typeof (MessagePriority)),
         new ConstValue(MessagePriority.High),
         ComparisonOperator.ValueEquality);
     Assert.AreEqual(expected, expression);
 }
 public virtual void Visit(ComparisonExpression expression)
 {
     expression.Left().Accept(this);
     expression.Right().Accept(this);
 }