Exemplo n.º 1
0
        public virtual QQueryBase.CreateCandidateCollectionResult CreateCandidateCollection
            ()
        {
            List4       candidatesList  = CreateQCandidatesList();
            bool        checkDuplicates = false;
            bool        topLevel        = true;
            IEnumerator i = IterateConstraints();

            while (i.MoveNext())
            {
                QCon constraint = (QCon)i.Current;
                QCon old        = constraint;
                constraint = constraint.GetRoot();
                if (constraint != old)
                {
                    checkDuplicates = true;
                    topLevel        = false;
                }
                ClassMetadata classMetadata = constraint.GetYapClass();
                if (classMetadata == null)
                {
                    break;
                }
                AddConstraintToCandidatesList(candidatesList, constraint);
            }
            return(new QQueryBase.CreateCandidateCollectionResult(candidatesList, checkDuplicates
                                                                  , topLevel));
        }
Exemplo n.º 2
0
 internal virtual Db4objects.Db4o.Internal.Query.Processor.QCon GetRoot()
 {
     if (i_parent != null)
     {
         return(i_parent.GetRoot());
     }
     return(this);
 }
Exemplo n.º 3
0
        private List4 CreateQCandidatesList()
        {
            List4       candidatesList = null;
            IEnumerator i = IterateConstraints();

            while (i.MoveNext())
            {
                QCon constraint = (QCon)i.Current;
                constraint = constraint.GetRoot();
                ClassMetadata classMetadata = constraint.GetYapClass();
                if (classMetadata == null)
                {
                    continue;
                }
                if (ConstraintCanBeAddedToExisting(candidatesList, constraint))
                {
                    continue;
                }
                QCandidates candidates = new QCandidates((LocalTransaction)_trans, classMetadata,
                                                         null);
                candidatesList = new List4(candidatesList, candidates);
            }
            return(candidatesList);
        }