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; }
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; }
public override void LoadFromQuery(QQuery query) { if (query.RequiresSort()) { _delegate = new IdListQueryResult(Transaction()); } _delegate.LoadFromQuery(query); }
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); }
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); }
public QLinRoot(IQuery query, Type clazz) { _query = (QQuery)query; query.Constrain(clazz); QLinSupport.Context(clazz); }
public _IEnumerable_28(QQuery query) { this.query = query; }
public QQuery(Transaction a_trans, QQuery a_parent, string a_field) : base(a_trans, a_parent, a_field) { }
/// <param name="q"></param> public virtual void LoadFromQuery(QQuery q) { throw new NotSupportedException(); }
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; }
protected QQueryBase() { // C/S only _this = Cast(this); }
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; }
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; } }
public override IQueryResult ExecuteQuery(QQuery query) { AbstractQueryResult queryResult = NewQueryResult(query.Transaction()); queryResult.LoadFromQuery(query); return queryResult; }
public abstract IQueryResult ExecuteQuery(QQuery query);
private AbstractQueryResult ExecuteFully(QQuery query) { return ((AbstractQueryResult)query.TriggeringQueryEvents(new _IClosure4_35(this, query))); }
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; }
public _IVisitor4_101(bool[] foundField, QQuery query) { this.foundField = foundField; this.query = query; }
protected QQueryBase() { // C/S only _this = Cast(this); }
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); }
public override void LoadFromQuery(QQuery query) { _iterable = new _IEnumerable_28(query); }
/// <param name="q"></param> public virtual void LoadFromQuery(QQuery q) { throw new NotImplementedException(); }
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); }
public QQuery(Transaction a_trans, QQuery a_parent, string a_field) : base(a_trans, a_parent, a_field) { }