Esempio n. 1
0
        internal override bool Evaluate(IInternalCandidate candidate)
        {
            bool        result      = true;
            QCandidates qCandidates = candidate.Candidates();

            if (qCandidates.IsTopLevel() && qCandidates.WasLoadedFromClassFieldIndex())
            {
                if (_classMetadata.GetAncestor() != null)
                {
                    BTreeClassIndexStrategy index = (BTreeClassIndexStrategy)_classMetadata.Index();
                    if (index == null)
                    {
                        return(i_evaluator.Not(true));
                    }
                    BTree  btree        = index.Btree();
                    object searchResult = btree.Search(candidate.Transaction(), candidate.Id());
                    result = searchResult != null;
                }
            }
            else
            {
                IReflectClass claxx = candidate.ClassMetadata().ClassReflector();
                if (claxx == null)
                {
                    result = false;
                }
                else
                {
                    result = i_equal ? _claxx.Equals(claxx) : _claxx.IsAssignableFrom(claxx);
                }
            }
            return(i_evaluator.Not(result));
        }
Esempio n. 2
0
		internal override bool Evaluate(IInternalCandidate candidate)
		{
			bool result = true;
			QCandidates qCandidates = candidate.Candidates();
			if (qCandidates.IsTopLevel() && qCandidates.WasLoadedFromClassFieldIndex())
			{
				if (_classMetadata.GetAncestor() != null)
				{
					BTreeClassIndexStrategy index = (BTreeClassIndexStrategy)_classMetadata.Index();
					if (index == null)
					{
						return i_evaluator.Not(true);
					}
					BTree btree = index.Btree();
					object searchResult = btree.Search(candidate.Transaction(), candidate.Id());
					result = searchResult != null;
				}
			}
			else
			{
				IReflectClass claxx = candidate.ClassMetadata().ClassReflector();
				if (claxx == null)
				{
					result = false;
				}
				else
				{
					result = i_equal ? _claxx.Equals(claxx) : _claxx.IsAssignableFrom(claxx);
				}
			}
			return i_evaluator.Not(result);
		}
Esempio n. 3
0
 internal override bool Evaluate(QConObject constraint, IInternalCandidate candidate
                                 , object obj)
 {
     if (obj != null)
     {
         if (obj is ByteArrayBuffer)
         {
             obj = StringHandler.ReadString(candidate.Transaction().Context(), (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);
 }
Esempio n. 4
0
		internal override bool Evaluate(QConObject constraint, IInternalCandidate candidate
			, object obj)
		{
			if (obj != null)
			{
				if (obj is ByteArrayBuffer)
				{
					obj = StringHandler.ReadString(candidate.Transaction().Context(), (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;
		}