Exemplo 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));
        }
Exemplo n.º 2
0
 private ITypeHandler4 TypeHandlerFor(IInternalCandidate candidate)
 {
     Db4objects.Db4o.Internal.ClassMetadata classMetadata = candidate.ClassMetadata();
     if (classMetadata != null)
     {
         return(classMetadata.TypeHandler());
     }
     return(null);
 }
Exemplo n.º 3
0
        public override void Visit(object obj)
        {
            IInternalCandidate qc = (IInternalCandidate)obj;
            bool res       = true;
            bool processed = false;

            if (_checkClassMetadataOnly)
            {
                ClassMetadata yc = qc.ClassMetadata();
                if (yc != null)
                {
                    res       = i_evaluator.Not(_classMetadata.GetHigherHierarchy(yc) == _classMetadata);
                    processed = true;
                }
            }
            if (!processed)
            {
                res = Evaluate(qc);
            }
            Visit1(qc.GetRoot(), this, res);
        }
Exemplo n.º 4
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);
		}