예제 #1
0
        internal virtual Db4objects.Db4o.Internal.Query.Processor.QCon AddSharedConstraint
            (QField a_field, object a_object)
        {
            QConObject newConstraint = new QConObject(i_trans, this, a_field, a_object);

            AddConstraint(newConstraint);
            return(newConstraint);
        }
예제 #2
0
        internal virtual QCon AddSharedConstraint
            (QField a_field, object a_object)
        {
            var newConstraint = new QConObject(i_trans, this, a_field, a_object);

            AddConstraint(newConstraint);
            return(newConstraint);
        }
예제 #3
0
 internal override bool Evaluate(QConObject a_constraint, QCandidate a_candidate,
                                 object a_value)
 {
     if (i_objectID == 0)
     {
         i_objectID = a_constraint.GetObjectID();
     }
     return(a_candidate._key == i_objectID);
 }
예제 #4
0
파일: QEIdentity.cs 프로젝트: erdincay/db4o
		internal override bool Evaluate(QConObject a_constraint, QCandidate a_candidate, 
			object a_value)
		{
			if (i_objectID == 0)
			{
				i_objectID = a_constraint.GetObjectID();
			}
			return a_candidate._key == i_objectID;
		}
예제 #5
0
		public IndexedNodeBase(QConObject qcon)
		{
			if (null == qcon)
			{
				throw new ArgumentNullException();
			}
			if (null == qcon.GetField())
			{
				throw new ArgumentException();
			}
			_constraint = qcon;
		}
예제 #6
0
 internal virtual bool Evaluate(QConObject a_constraint, QE a_evaluator)
 {
     if (a_evaluator.Identity())
     {
         return(a_evaluator.Evaluate(a_constraint, this, null));
     }
     if (_member == null)
     {
         _member = Value();
     }
     return(a_evaluator.Evaluate(a_constraint, this, a_constraint.Translate(_member)));
 }
예제 #7
0
파일: QEMulti.cs 프로젝트: erdincay/db4o
		internal override bool Evaluate(QConObject a_constraint, QCandidate a_candidate, 
			object a_value)
		{
			IEnumerator i = i_evaluators.GetEnumerator();
			while (i.MoveNext())
			{
				if (((QE)i.Current).Evaluate(a_constraint, a_candidate, a_value))
				{
					return true;
				}
			}
			return false;
		}
예제 #8
0
		internal virtual bool Evaluate(QConObject constraint, QCandidate candidate, object
			 obj)
		{
			IPreparedComparison prepareComparison = constraint.PrepareComparison(candidate);
			if (obj == null)
			{
				return prepareComparison is Null;
			}
			if (prepareComparison is PreparedArrayContainsComparison)
			{
				return ((PreparedArrayContainsComparison)prepareComparison).IsEqual(obj);
			}
			return prepareComparison.CompareTo(obj) == 0;
		}
예제 #9
0
		internal override bool Evaluate(QConObject constraint, QCandidate candidate, object
			 obj)
		{
			if (obj == null)
			{
				return false;
			}
			IPreparedComparison preparedComparison = constraint.PrepareComparison(candidate);
			if (preparedComparison is PreparedArrayContainsComparison)
			{
				return ((PreparedArrayContainsComparison)preparedComparison).IsGreaterThan(obj);
			}
			return preparedComparison.CompareTo(obj) > 0;
		}
예제 #10
0
        internal override bool Evaluate(QConObject a_constraint, QCandidate a_candidate,
                                        object a_value)
        {
            var i = i_evaluators.GetEnumerator();

            while (i.MoveNext())
            {
                if (((QE)i.Current).Evaluate(a_constraint, a_candidate, a_value))
                {
                    return(true);
                }
            }
            return(false);
        }
예제 #11
0
        internal virtual bool Evaluate(QConObject constraint, QCandidate candidate, object
                                       obj)
        {
            IPreparedComparison prepareComparison = constraint.PrepareComparison(candidate);

            if (obj == null)
            {
                return(prepareComparison is Null);
            }
            if (prepareComparison is PreparedArrayContainsComparison)
            {
                return(((PreparedArrayContainsComparison)prepareComparison).IsEqual(obj));
            }
            return(prepareComparison.CompareTo(obj) == 0);
        }
예제 #12
0
        internal override bool Evaluate(QConObject constraint, QCandidate candidate, object
                                        obj)
        {
            if (obj == null)
            {
                return(false);
            }
            IPreparedComparison preparedComparison = constraint.PrepareComparison(candidate);

            if (preparedComparison is PreparedArrayContainsComparison)
            {
                return(((PreparedArrayContainsComparison)preparedComparison).IsGreaterThan(obj));
            }
            return(preparedComparison.CompareTo(obj) > 0);
        }
예제 #13
0
        private void AddConstraint(Collection4 col, object obj)
        {
            if (AttachToExistingConstraints(col, obj, true))
            {
                return;
            }
            if (AttachToExistingConstraints(col, obj, false))
            {
                return;
            }
            QConObject newConstraint = new QConObject(_trans, null, null, obj);

            AddConstraint(newConstraint);
            col.Add(newConstraint);
        }
예제 #14
0
		internal override QCon ShareParent(object a_object, BooleanByRef removeExisting)
		{
			if (i_parent == null)
			{
				return null;
			}
			object obj = GetField().Coerce(a_object);
			if (obj == No4.Instance)
			{
				QCon falseConstraint = new QConUnconditional(i_trans, false);
				Morph(removeExisting, falseConstraint, ReflectClassForObject(obj));
				return falseConstraint;
			}
			QConObject newConstraint = new QConObject(i_trans, i_parent, GetField(), obj);
			Morph(removeExisting, newConstraint, ReflectClassForObject(obj));
			return newConstraint;
		}
예제 #15
0
        internal override QCon ShareParent(object a_object, BooleanByRef removeExisting)
        {
            if (i_parent == null)
            {
                return(null);
            }
            object obj = GetField().Coerce(a_object);

            if (obj == No4.Instance)
            {
                QCon falseConstraint = new QConUnconditional(i_trans, false);
                Morph(removeExisting, falseConstraint, ReflectClassForObject(obj));
                return(falseConstraint);
            }
            QConObject newConstraint = new QConObject(i_trans, i_parent, GetField(), obj);

            Morph(removeExisting, newConstraint, ReflectClassForObject(obj));
            return(newConstraint);
        }
예제 #16
0
 internal override bool Evaluate(QConObject constraint, QCandidate candidate, object
                                 obj)
 {
     if (obj != null)
     {
         if (obj is ByteArrayBuffer)
         {
             obj = candidate.ReadString((ByteArrayBuffer)obj);
         }
         string candidateStringValue = obj.ToString();
         string stringConstraint     = constraint.GetObject().ToString();
         if (!caseSensitive)
         {
             candidateStringValue = candidateStringValue.ToLower();
             stringConstraint     = stringConstraint.ToLower();
         }
         return(CompareStrings(candidateStringValue, stringConstraint));
     }
     return(constraint.GetObject() == null);
 }
예제 #17
0
		internal override bool Evaluate(QConObject constraint, QCandidate candidate, object
			 obj)
		{
			if (obj != null)
			{
				if (obj is ByteArrayBuffer)
				{
					obj = candidate.ReadString((ByteArrayBuffer)obj);
				}
				string candidateStringValue = obj.ToString();
				string stringConstraint = constraint.GetObject().ToString();
				if (!caseSensitive)
				{
					candidateStringValue = candidateStringValue.ToLower();
					stringConstraint = stringConstraint.ToLower();
				}
				return CompareStrings(candidateStringValue, stringConstraint);
			}
			return constraint.GetObject() == null;
		}
예제 #18
0
파일: QCon.cs 프로젝트: Galigator/db4o
		internal virtual Db4objects.Db4o.Internal.Query.Processor.QCon AddSharedConstraint
			(QField a_field, object a_object)
		{
			QConObject newConstraint = new QConObject(i_trans, this, a_field, a_object);
			AddConstraint(newConstraint);
			return newConstraint;
		}
예제 #19
0
 public virtual void CollectConstraints(Transaction trans, QConObject parentConstraint
     , object obj, IVisitor4 visitor)
 {
     TraverseAllAspects(new _TraverseFieldCommand_536(trans, parentConstraint, obj, visitor
         ));
 }
예제 #20
0
파일: QCandidate.cs 프로젝트: masroore/db4o
 internal virtual bool Evaluate(QConObject a_constraint, QE a_evaluator)
 {
     if (a_evaluator.Identity())
     {
         return a_evaluator.Evaluate(a_constraint, this, null);
     }
     if (_member == null)
     {
         _member = Value();
     }
     return a_evaluator.Evaluate(a_constraint, this, a_constraint.Translate(_member));
 }
예제 #21
0
 public abstract bool Evaluate(QConObject arg1, QE arg2);
예제 #22
0
		public IndexedLeaf(QConObject qcon) : base(qcon)
		{
			_range = Search();
		}
 public override bool Evaluate(QConObject a_constraint, QE a_evaluator)
 {
     return(a_evaluator.Evaluate(a_constraint, this, a_constraint.Translate(_obj)));
 }
예제 #24
0
 internal override bool Evaluate(QConObject a_constraint, IInternalCandidate a_candidate
                                 , object a_value)
 {
     return(!i_evaluator.Evaluate(a_constraint, a_candidate, a_value));
 }
예제 #25
0
 public _IVisitor4_84(QConObject _enclosing)
 {
     this._enclosing = _enclosing;
 }
예제 #26
0
		public IndexedPath(QConObject parent, IIndexedNode next) : base(parent)
		{
			_next = next;
		}
예제 #27
0
		private IndexedLeaf FindLeafOnSameField(QConObject conObject)
		{
			IEnumerator i = _nodes.GetEnumerator();
			while (i.MoveNext())
			{
				if (i.Current is IndexedLeaf)
				{
					IndexedLeaf leaf = (IndexedLeaf)i.Current;
					if (conObject.OnSameFieldAs(leaf.Constraint()))
					{
						return leaf;
					}
				}
			}
			return null;
		}
예제 #28
0
		private Collection4 CollectTopLevelJoins(QConObject constraintWithJoins)
		{
			Collection4 joins = new Collection4();
			CollectTopLevelJoins(joins, constraintWithJoins);
			return joins;
		}
예제 #29
0
파일: QCon.cs 프로젝트: masroore/db4o
 internal virtual QCon AddSharedConstraint
     (QField a_field, object a_object)
 {
     var newConstraint = new QConObject(i_trans, this, a_field, a_object);
     AddConstraint(newConstraint);
     return newConstraint;
 }
예제 #30
0
		private void CollectJoinedNode(QConObject constraintWithJoins)
		{
			Collection4 joins = CollectTopLevelJoins(constraintWithJoins);
			if (!CanJoinsBeSearchedByIndex(joins))
			{
				return;
			}
			if (1 == joins.Size())
			{
				_nodes.Add(NodeForConstraint((QCon)joins.SingleElement()));
				return;
			}
			CollectImplicitlyAndingJoins(joins, constraintWithJoins);
		}
예제 #31
0
		private void CollectStandaloneNode(QConObject conObject)
		{
			IndexedLeaf existing = FindLeafOnSameField(conObject);
			if (existing != null)
			{
				CollectImplicitAnd(conObject, existing, new IndexedLeaf(conObject));
			}
			else
			{
				_nodes.Add(new IndexedLeaf(conObject));
			}
		}
예제 #32
0
파일: QENot.cs 프로젝트: superyfwy/db4o
		internal override bool Evaluate(QConObject a_constraint, IInternalCandidate a_candidate
			, object a_value)
		{
			return !i_evaluator.Evaluate(a_constraint, a_candidate, a_value);
		}
예제 #33
0
 public _TraverseFieldCommand_536(Transaction trans, QConObject parentConstraint,
     object obj, IVisitor4 visitor)
 {
     this.trans = trans;
     this.parentConstraint = parentConstraint;
     this.obj = obj;
     this.visitor = visitor;
 }
예제 #34
0
파일: QQueryBase.cs 프로젝트: masroore/db4o
 private void AddConstraint(Collection4 col, object obj)
 {
     if (AttachToExistingConstraints(col, obj, true))
     {
         return;
     }
     if (AttachToExistingConstraints(col, obj, false))
     {
         return;
     }
     var newConstraint = new QConObject(_trans, null, null, obj);
     AddConstraint(newConstraint);
     col.Add(newConstraint);
 }
예제 #35
0
		public abstract bool Evaluate(QConObject arg1, QE arg2);
예제 #36
0
		internal virtual void CollectConstraints(Transaction trans, QConObject a_parent, 
			object a_template, IVisitor4 a_visitor)
		{
			object obj = GetOn(trans, a_template);
			if (obj != null)
			{
				Collection4 objs = Platform4.FlattenCollection(trans.Container(), obj);
				IEnumerator j = objs.GetEnumerator();
				while (j.MoveNext())
				{
					obj = j.Current;
					if (obj != null)
					{
						if (_isPrimitive && !_isArray)
						{
							object nullValue = _reflectField.GetFieldType().NullValue();
							if (obj.Equals(nullValue))
							{
								return;
							}
						}
						if (Platform4.IgnoreAsConstraint(obj))
						{
							return;
						}
						if (!a_parent.HasObjectInParentPath(obj))
						{
							QConObject constraint = new QConObject(trans, a_parent, QField(trans), obj);
							constraint.ByExample();
							a_visitor.Visit(constraint);
						}
					}
				}
			}
		}
예제 #37
0
		public override bool Evaluate(QConObject a_constraint, QE a_evaluator)
		{
			return a_evaluator.Evaluate(a_constraint, this, a_constraint.Translate(_obj));
		}
예제 #38
0
			public _IVisitor4_84(QConObject _enclosing)
			{
				this._enclosing = _enclosing;
			}
예제 #39
0
		private void CollectImplicitlyAndingJoins(Collection4 joins, QConObject constraintWithJoins
			)
		{
			IEnumerator i = joins.GetEnumerator();
			i.MoveNext();
			IIndexedNodeWithRange last = NodeForConstraint((QCon)i.Current);
			while (i.MoveNext())
			{
				IIndexedNodeWithRange node = NodeForConstraint((QCon)i.Current);
				last = new AndIndexedLeaf(constraintWithJoins, node, last);
				_nodes.Add(last);
			}
		}
예제 #40
0
		internal override void CollectConstraints(Transaction a_trans, QConObject a_parent
			, object a_template, IVisitor4 a_visitor)
		{
		}