コード例 #1
0
            public object Run()
            {
                AbstractQueryResult qr = this._enclosing.NewQueryResult(query.EvaluationMode());

                qr.LoadFromQuery(query);
                return(qr);
            }
コード例 #2
0
        private IQueryResult ClassOnlyQuery()
        {
            AbstractQueryResult queryResult = NewQueryResult();

            queryResult.LoadFromClassIndex(ClassMetadata());
            return(queryResult);
        }
コード例 #3
0
        private IQueryResult ExecuteQuery(IQuery query)
        {
            AbstractQueryResult queryResult = NewQueryResult();

            queryResult.LoadFromQuery((QQuery)query);
            return(queryResult);
        }
コード例 #4
0
        public override IQueryResult ExecuteQuery(QQuery query)
        {
            AbstractQueryResult queryResult = NewQueryResult(query.Transaction());

            queryResult.LoadFromQuery(query);
            return(queryResult);
        }
コード例 #5
0
ファイル: MsgQuery.cs プロジェクト: git-thinh/limada
        private MsgD WriteImmediateQueryResult(AbstractQueryResult queryResult, ObjectExchangeConfiguration
                                               config)
        {
            IIntIterator4 idIterator = queryResult.IterateIDs();
            MsgD          message    = BuildQueryResultMessage(0, idIterator, queryResult.Size(), config);

            return(message);
        }
コード例 #6
0
ファイル: MObjectSetSize.cs プロジェクト: danfma/db4o-net
 public virtual Msg ReplyFromServer()
 {
     lock (ContainerLock())
     {
         AbstractQueryResult queryResult = QueryResult(ReadInt());
         return(Msg.ObjectsetSize.GetWriterForInt(Transaction(), queryResult.Size()));
     }
 }
コード例 #7
0
        public virtual void TestGetAll()
        {
            AbstractQueryResult queryResult = NewQueryResult();

            queryResult.LoadFromClassIndexes(Container().ClassCollection().Iterator());
            int[] ids = IntArrays4.Concat(itemIds, new int[] { idForGetAll });
            AssertIDs(queryResult, ids, true);
        }
コード例 #8
0
        public virtual AbstractQueryResult GetAll(Transaction trans, QueryEvaluationMode
                                                  mode)
        {
            AbstractQueryResult queryResult = NewQueryResult(trans, mode);

            queryResult.LoadFromClassIndexes(ClassCollection().Iterator());
            return(queryResult);
        }
コード例 #9
0
ファイル: MsgQuery.cs プロジェクト: git-thinh/limada
 protected MsgD WriteQueryResult(AbstractQueryResult queryResult, QueryEvaluationMode
                                 evaluationMode, ObjectExchangeConfiguration config)
 {
     if (evaluationMode == QueryEvaluationMode.Immediate)
     {
         return(WriteImmediateQueryResult(queryResult, config));
     }
     return(WriteLazyQueryResult(queryResult, config));
 }
コード例 #10
0
            public void Run()
            {
                ByteArrayBuffer     reader        = this._enclosing.ExpectedBufferResponse(Msg.QueryResult);
                int                 queryResultID = reader.ReadInt();
                AbstractQueryResult queryResult   = this._enclosing.QueryResultFor(trans, queryResultID
                                                                                   );

                queryResult.LoadFromIdReader(this._enclosing.IdIteratorFor(trans, reader));
                result.value = queryResult;
            }
コード例 #11
0
        public virtual Msg ReplyFromServer()
        {
            AbstractQueryResult queryResult = QueryResult(ReadInt());

            lock (ContainerLock())
            {
                int id = queryResult.IndexOf(ReadInt());
                return(Msg.ObjectsetIndexof.GetWriterForInt(Transaction(), id));
            }
        }
コード例 #12
0
        /// <summary>
        /// The default
        /// <see cref="ClientQueryResultIterator">ClientQueryResultIterator</see>
        /// for this platform.
        /// </summary>
        /// <returns></returns>
        public static IEnumerator CreateClientQueryResultIterator(AbstractQueryResult result
                                                                  )
        {
            IQueryResultIteratorFactory factory = result.Config().QueryResultIteratorFactory(
                );

            if (null != factory)
            {
                return(factory.NewInstance(result));
            }
            return(new ClientQueryResultIterator(result));
        }
コード例 #13
0
        public override IQueryResult ClassOnlyQuery(QQueryBase query, ClassMetadata clazz
                                                    )
        {
            if (!clazz.HasClassIndex())
            {
                return(new IdListQueryResult(query.Transaction()));
            }
            AbstractQueryResult queryResult = NewQueryResult(query.Transaction());

            queryResult.LoadFromClassIndex(clazz);
            return(queryResult);
        }
コード例 #14
0
ファイル: MsgQuery.cs プロジェクト: git-thinh/limada
        private MsgD WriteLazyQueryResult(AbstractQueryResult queryResult, ObjectExchangeConfiguration
                                          config)
        {
            int           queryResultId = GenerateID();
            int           maxCount      = Config().PrefetchObjectCount();
            IIntIterator4 idIterator    = queryResult.IterateIDs();
            MsgD          message       = BuildQueryResultMessage(queryResultId, idIterator, maxCount, config
                                                                  );
            IServerMessageDispatcher serverThread = ServerMessageDispatcher();

            serverThread.MapQueryResultToID(new LazyClientObjectSetStub(queryResult, idIterator
                                                                        ), queryResultId);
            return(message);
        }
コード例 #15
0
 public LazyClientObjectSetStub(AbstractQueryResult queryResult, IIntIterator4 idIterator
                                )
 {
     _queryResult = queryResult;
     _idIterator  = idIterator;
 }
コード例 #16
0
 internal ClientQueryResultIterator(AbstractQueryResult client)
 {
     _client = client;
     _ids    = client.IterateIDs();
 }