示例#1
0
        public virtual IEnumerator ExecuteLazy()
        {
            CheckConstraintsEvaluationMode();
            QQueryBase.CreateCandidateCollectionResult r = CreateCandidateCollection();
            Collection4     executionPath       = ExecutionPath(r);
            IEnumerator     candidateCollection = new Iterator4Impl(r.candidateCollection);
            MappingIterator executeCandidates   = new _MappingIterator_438(executionPath, candidateCollection
                                                                           );
            CompositeIterator4 resultingIDs = new CompositeIterator4(executeCandidates);

            if (!r.checkDuplicates)
            {
                return(resultingIDs);
            }
            return(CheckDuplicates(resultingIDs));
        }
示例#2
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();
                }
                ObjectContainerBase stream = Stream();
                i = new Iterator4Impl(candidateCollection);
                while (i.MoveNext())
                {
                    QCandidates candidates = (QCandidates)i.Current;
                    if (topLevel)
                    {
                        candidates.Traverse(result);
                    }
                    else
                    {
                        candidates.Traverse(new _IVisitor4_374(this, executionPath, stream, result));
                    }
                }
            }
            Sort(result);
        }
示例#3
0
        public virtual IEnumerator ExecuteSnapshot()
        {
            QQueryBase.CreateCandidateCollectionResult r = CreateCandidateCollection();
            Collection4 executionPath      = ExecutionPath(r);
            IEnumerator candidatesIterator = new Iterator4Impl(r.candidateCollection);
            Collection4 snapshots          = new Collection4();

            while (candidatesIterator.MoveNext())
            {
                QCandidates candidates = (QCandidates)candidatesIterator.Current;
                snapshots.Add(candidates.ExecuteSnapshot(executionPath));
            }
            IEnumerator        snapshotsIterator = snapshots.GetEnumerator();
            CompositeIterator4 resultingIDs      = new CompositeIterator4(snapshotsIterator);

            if (!r.checkDuplicates)
            {
                return(resultingIDs);
            }
            return(CheckDuplicates(resultingIDs));
        }
示例#4
0
 private Collection4 ExecutionPath(QQueryBase.CreateCandidateCollectionResult r)
 {
     return(r.topLevel ? null : FieldPathFromTop());
 }