Esempio n. 1
0
 protected QQueryBase(Transaction a_trans, QQuery a_parent
     , string a_field)
 {
     _this = Cast(this);
     _trans = a_trans;
     i_parent = a_parent;
     i_field = a_field;
 }
Esempio n. 2
0
		protected QQueryBase(Db4objects.Db4o.Internal.Transaction a_trans, QQuery a_parent
			, string a_field)
		{
			_this = Cast(this);
			_trans = a_trans;
			i_parent = a_parent;
			i_field = a_field;
		}
Esempio n. 3
0
		public override void LoadFromQuery(QQuery query)
		{
			if (query.RequiresSort())
			{
				_delegate = new IdListQueryResult(Transaction());
			}
			_delegate.LoadFromQuery(query);
		}
Esempio n. 4
0
        internal virtual bool Attach(QQuery query, string a_field)
        {
            Db4objects.Db4o.Internal.Query.Processor.QCon qcon = this;
            ClassMetadata yc = GetYapClass();

            bool[] foundField = new bool[] { false };
            ForEachChildField(a_field, new _IVisitor4_101(foundField, query));
            if (foundField[0])
            {
                return(true);
            }
            QField qf = null;

            if (yc == null || yc.HoldsAnyClass())
            {
                int[]           count = new int[] { 0 };
                FieldMetadata[] yfs   = new FieldMetadata[] { null };
                i_trans.Container().ClassCollection().AttachQueryNode(a_field, new _IVisitor4_119
                                                                          (yfs, count));
                if (count[0] == 0)
                {
                    return(false);
                }
                if (count[0] == 1)
                {
                    qf = yfs[0].QField(i_trans);
                }
                else
                {
                    qf = new QField(i_trans, a_field, null, 0, 0);
                }
            }
            else
            {
                if (yc.IsTranslated())
                {
                    i_trans.Container()._handlers.DiagnosticProcessor().DescendIntoTranslator(yc, a_field
                                                                                              );
                }
                FieldMetadata yf = yc.FieldMetadataForName(a_field);
                if (yf != null)
                {
                    qf = yf.QField(i_trans);
                }
                if (qf == null)
                {
                    qf = new QField(i_trans, a_field, null, 0, 0);
                }
            }
            QConPath qcp = new QConPath(i_trans, qcon, qf);

            query.AddConstraint(qcp);
            qcon.AddConstraint(qcp);
            return(true);
        }
Esempio n. 5
0
 public virtual IQuery Descend(string a_field)
 {
     lock (StreamLock())
     {
         QQuery   query = new QQuery(_trans, _this, a_field);
         IntByRef run   = new IntByRef(1);
         if (!Descend1(query, a_field, run))
         {
             // try to add unparented nodes on the second run,
             // if not added in the first run and a descendant
             // was not found
             if (run.value == 1)
             {
                 run.value = 2;
                 if (!Descend1(query, a_field, run))
                 {
                     new QConUnconditional(_trans, false).Attach(query, a_field);
                 }
             }
         }
         return(query);
     }
 }
		public override void LoadFromQuery(QQuery query)
		{
			IEnumerator _iterator = query.ExecuteSnapshot();
			_iterable = new _IEnumerable_29(_iterator);
		}
Esempio n. 7
0
		public QLinRoot(IQuery query, Type clazz)
		{
			_query = (QQuery)query;
			query.Constrain(clazz);
			QLinSupport.Context(clazz);
		}
Esempio n. 8
0
 public _IEnumerable_28(QQuery query)
 {
     this.query = query;
 }
Esempio n. 9
0
 public QQuery(Transaction a_trans, QQuery
     a_parent, string a_field) : base(a_trans, a_parent, a_field)
 {
 }
Esempio n. 10
0
		/// <param name="q"></param>
		public virtual void LoadFromQuery(QQuery q)
		{
			throw new NotSupportedException();
		}
Esempio n. 11
0
		internal virtual bool Attach(QQuery query, string a_field)
		{
			Db4objects.Db4o.Internal.Query.Processor.QCon qcon = this;
			ClassMetadata yc = GetYapClass();
			bool[] foundField = new bool[] { false };
			ForEachChildField(a_field, new _IVisitor4_101(foundField, query));
			if (foundField[0])
			{
				return true;
			}
			QField qf = null;
			if (yc == null || yc.HoldsAnyClass())
			{
				int[] count = new int[] { 0 };
				FieldMetadata[] yfs = new FieldMetadata[] { null };
				i_trans.Container().ClassCollection().AttachQueryNode(a_field, new _IVisitor4_119
					(yfs, count));
				if (count[0] == 0)
				{
					return false;
				}
				if (count[0] == 1)
				{
					qf = yfs[0].QField(i_trans);
				}
				else
				{
					qf = new QField(i_trans, a_field, null, 0, 0);
				}
			}
			else
			{
				if (yc.IsTranslated())
				{
					i_trans.Container()._handlers.DiagnosticProcessor().DescendIntoTranslator(yc, a_field
						);
				}
				FieldMetadata yf = yc.FieldMetadataForName(a_field);
				if (yf != null)
				{
					qf = yf.QField(i_trans);
				}
				if (qf == null)
				{
					qf = new QField(i_trans, a_field, null, 0, 0);
				}
			}
			QConPath qcp = new QConPath(i_trans, qcon, qf);
			query.AddConstraint(qcp);
			qcon.AddConstraint(qcp);
			return true;
		}
Esempio n. 12
0
 protected QQueryBase()
 {
     // C/S only
     _this = Cast(this);
 }
Esempio n. 13
0
 private bool Descend1(QQuery query, string fieldName, IntByRef run)
 {
     if (run.value == 2 || i_constraints.Size() == 0)
     {
         // On the second run we are really creating a second independant
         // query network that is not joined to other higher level
         // constraints.
         // Let's see how this works out. We may need to join networks.
         run.value = 0;
         // prevent a double run of this code
         Stream().ClassCollection().AttachQueryNode(fieldName, new _IVisitor4_275(this));
     }
     CheckConstraintsEvaluationMode();
     var foundClass = new BooleanByRef(false);
     var i = IterateConstraints();
     while (i.MoveNext())
     {
         if (((QCon) i.Current).Attach(query, fieldName))
         {
             foundClass.value = true;
         }
     }
     return foundClass.value;
 }
Esempio n. 14
0
 public virtual IQuery Descend(string a_field)
 {
     lock (StreamLock())
     {
         var query = new QQuery(_trans, _this, a_field);
         var run = new IntByRef(1);
         if (!Descend1(query, a_field, run))
         {
             // try to add unparented nodes on the second run,
             // if not added in the first run and a descendant
             // was not found
             if (run.value == 1)
             {
                 run.value = 2;
                 if (!Descend1(query, a_field, run))
                 {
                     new QConUnconditional(_trans, false).Attach(query, a_field);
                 }
             }
         }
         return query;
     }
 }
Esempio n. 15
0
		public override IQueryResult ExecuteQuery(QQuery query)
		{
			AbstractQueryResult queryResult = NewQueryResult(query.Transaction());
			queryResult.LoadFromQuery(query);
			return queryResult;
		}
Esempio n. 16
0
		public abstract IQueryResult ExecuteQuery(QQuery query);
		private AbstractQueryResult ExecuteFully(QQuery query)
		{
			return ((AbstractQueryResult)query.TriggeringQueryEvents(new _IClosure4_35(this, 
				query)));
		}
Esempio n. 18
0
 public _IVisitor4_101(bool[] foundField, QQuery query)
 {
     this.foundField = foundField;
     this.query      = query;
 }
			public _IClosure4_35(MQueryExecute _enclosing, QQuery query)
			{
				this._enclosing = _enclosing;
				this.query = query;
			}
Esempio n. 20
0
			public _IVisitor4_101(bool[] foundField, QQuery query)
			{
				this.foundField = foundField;
				this.query = query;
			}
Esempio n. 21
0
 protected QQueryBase()
 {
     // C/S only
     _this = Cast(this);
 }
Esempio n. 22
0
 public QQuery(Transaction a_trans, Db4objects.Db4o.Internal.Query.Processor.QQuery
               a_parent, string a_field) : base(a_trans, a_parent, a_field)
 {
 }
		public override void LoadFromQuery(QQuery query)
		{
			query.ExecuteLocal(this);
		}
Esempio n. 24
0
 public override void LoadFromQuery(QQuery query)
 {
     _iterable = new _IEnumerable_28(query);
 }
Esempio n. 25
0
		/// <param name="q"></param>
		public virtual void LoadFromQuery(QQuery q)
		{
			throw new NotImplementedException();
		}
Esempio n. 26
0
		public override IQueryResult ExecuteQuery(QQuery query)
		{
			Transaction trans = query.Transaction();
			query.CaptureQueryResultConfig();
			query.Marshall();
			MsgD msg = Msg.QueryExecute.GetWriter(Serializer.Marshall(trans, query));
			Write(msg);
			return ReadQueryResult(trans);
		}
Esempio n. 27
0
 public QQuery(Transaction a_trans, QQuery
               a_parent, string a_field) : base(a_trans, a_parent, a_field)
 {
 }