Esempio n. 1
0
        public virtual void ExecuteLocal(IdListQueryResult result)
        {
            CheckConstraintsEvaluationMode();
            QQueryBase.CreateCandidateCollectionResult r = CreateCandidateCollection();
            bool  checkDuplicates     = r.checkDuplicates;
            bool  topLevel            = r.topLevel;
            List4 candidateCollection = r.candidateCollection;

            if (candidateCollection != null)
            {
                Collection4 executionPath = topLevel ? null : FieldPathFromTop();
                IEnumerator i             = new Iterator4Impl(candidateCollection);
                while (i.MoveNext())
                {
                    ((QCandidates)i.Current).Execute();
                }
                if (((List4)candidateCollection._next) != null)
                {
                    checkDuplicates = true;
                }
                if (checkDuplicates)
                {
                    result.CheckDuplicates();
                }
                i = new Iterator4Impl(candidateCollection);
                while (i.MoveNext())
                {
                    QCandidates candidates = (QCandidates)i.Current;
                    if (topLevel)
                    {
                        candidates.TraverseIds(result);
                    }
                    else
                    {
                        candidates.TraverseIds(new QQueryBase.AscendingQueryExecutor(_trans, result, executionPath
                                                                                     ));
                    }
                }
            }
            Sort(result);
        }
Esempio n. 2
0
        public virtual void ExecuteLocal(IdListQueryResult result)
        {
            CheckConstraintsEvaluationMode();
            var r = CreateCandidateCollection();
            var checkDuplicates     = r.checkDuplicates;
            var topLevel            = r.topLevel;
            var candidateCollection = r.candidateCollection;

            if (candidateCollection != null)
            {
                var         executionPath = topLevel ? null : FieldPathFromTop();
                IEnumerator i             = new Iterator4Impl(candidateCollection);
                while (i.MoveNext())
                {
                    ((QCandidates)i.Current).Execute();
                }
                if (candidateCollection._next != null)
                {
                    checkDuplicates = true;
                }
                if (checkDuplicates)
                {
                    result.CheckDuplicates();
                }
                var stream = Stream();
                i = new Iterator4Impl(candidateCollection);
                while (i.MoveNext())
                {
                    var candidates = (QCandidates)i.Current;
                    if (topLevel)
                    {
                        candidates.Traverse(result);
                    }
                    else
                    {
                        candidates.Traverse(new _IVisitor4_374(this, executionPath, stream, result));
                    }
                }
            }
            Sort(result);
        }