예제 #1
0
        public Int32 GetObjectCount(DataQueryBuilder dataQueryBuilder)
        {
            BackendlessDataQuery dataQuery = dataQueryBuilder.Build();

            return(Invoker.InvokeSync <Int32>(PERSISTENCE_MANAGER_SERVER_ALIAS, "count", new Object[] { tableName, dataQuery },
                                              true));
        }
예제 #2
0
        public void GetObjectCount(DataQueryBuilder dataQueryBuilder, AsyncCallback <Int32> responder)
        {
            BackendlessDataQuery dataQuery = dataQueryBuilder.Build();

            Invoker.InvokeAsync <Int32>(PERSISTENCE_MANAGER_SERVER_ALIAS, "count", new Object[] { tableName, dataQuery }, true,
                                        responder);
        }
예제 #3
0
        public void Find <T>(DataQueryBuilder dataQueryBuilder, AsyncCallback <IList <T> > callback)
        {
            var responder = new AsyncCallback <IList <T> >(r =>
            {
                if (callback != null)
                {
                    callback.ResponseHandler.Invoke(r);
                }
            }, f =>
            {
                if (callback != null)
                {
                    callback.ErrorHandler.Invoke(f);
                }
                else
                {
                    throw new BackendlessException(f);
                }
            });

            BackendlessDataQuery dataQuery = dataQueryBuilder != null?dataQueryBuilder.Build() : null;

            AddWeborbPropertyMapping <T>();
            Invoker.InvokeAsync(PERSISTENCE_MANAGER_SERVER_ALIAS, "find",
                                new object[] { GetTypeName(typeof(T)), dataQuery },
                                true,
                                responder);
        }
예제 #4
0
        public void Find(DataQueryBuilder dataQueryBuilder, AsyncCallback <IList <Dictionary <String, Object> > > callback)
        {
            var responder = new AsyncCallback <IList <Dictionary <String, Object> > >(
                r =>
            {
                if (callback != null)
                {
                    callback.ResponseHandler.Invoke(r);
                }
            },
                f =>
            {
                if (callback != null)
                {
                    callback.ErrorHandler.Invoke(f);
                }
                else
                {
                    throw new BackendlessException(f);
                }
            });

            if (dataQueryBuilder == null)
            {
                dataQueryBuilder = DataQueryBuilder.Create();
            }

            BackendlessDataQuery dataQuery = dataQueryBuilder.Build();

            Object[] args = { tableName, dataQuery };
            Invoker.InvokeAsync(PERSISTENCE_MANAGER_SERVER_ALIAS, "find", args, responder);
        }
예제 #5
0
        public int GetObjectCount <T>(DataQueryBuilder dataQueryBuilder)
        {
            BackendlessDataQuery dataQuery = dataQueryBuilder.Build();

            return(Invoker.InvokeSync <int>(PERSISTENCE_MANAGER_SERVER_ALIAS, "count",
                                            new object[] { GetTypeName(typeof(T)), dataQuery }, true));
        }
예제 #6
0
        public IList <T> Find <T>(DataQueryBuilder dataQueryBuilder)
        {
            BackendlessDataQuery dataQuery = dataQueryBuilder != null?dataQueryBuilder.Build() : null;

            AddWeborbPropertyMapping <T>();
            var result = Invoker.InvokeSync <IList <T> >(PERSISTENCE_MANAGER_SERVER_ALIAS, "find",
                                                         new object[] { GetTypeName(typeof(T)), dataQuery }, true);

            return((IList <T>)result);
        }
예제 #7
0
        public OpResult Find(String tableName, DataQueryBuilder queryBuilder)
        {
            BackendlessDataQuery query = queryBuilder.Build();

            String        operationResultId = opResultIdGenerator.GenerateOpResultId(OperationType.FIND, tableName);
            OperationFind operationFind     = new OperationFind(OperationType.FIND, tableName, operationResultId, query);

            operations.AddLast(operationFind);

            return(TransactionHelper.MakeOpResult(tableName, operationResultId, OperationType.FIND));
        }
예제 #8
0
        public IList <Dictionary <String, Object> > Find(DataQueryBuilder dataQueryBuilder)
        {
            if (dataQueryBuilder == null)
            {
                dataQueryBuilder = DataQueryBuilder.Create();
            }

            BackendlessDataQuery dataQuery = dataQueryBuilder.Build();

            PersistenceService.CheckPageSizeAndOffset(dataQuery);

            Object[] args = { tableName, dataQuery };
            return(Invoker.InvokeSync <IList <Dictionary <String, Object> > >(PERSISTENCE_MANAGER_SERVER_ALIAS, "find", args));
        }
        public IList <Dictionary <string, object> > Find(DataQueryBuilder dataQueryBuilder)
        {
            BackendlessDataQuery dataQuery = null;

            if (dataQueryBuilder != null)
            {
                dataQuery = dataQueryBuilder.Build();
                PersistenceService.CheckPageSizeAndOffset(dataQuery);
            }

            object[] args   = new object[] { tableName, dataQueryBuilder };
            var      result = Invoker.InvokeSync <IList <Dictionary <string, object> > >(PERSISTENCE_MANAGER_SERVER_ALIAS, "find", args);

            return((IList <Dictionary <string, object> >)result);
        }
예제 #10
0
        internal void FindByIdViaDataQueryBuilder <T>(String id, DataQueryBuilder queryBuilder, AsyncCallback <T> callback)
        {
            if (id == null)
            {
                throw new ArgumentException(ExceptionMessage.NULL_ID);
            }

            if (queryBuilder == null)
            {
                queryBuilder = DataQueryBuilder.Create();
            }

            BackendlessDataQuery dataQuery = queryBuilder.Build();

            AddWeborbPropertyMapping <T>();
            Invoker.InvokeAsync(PERSISTENCE_MANAGER_SERVER_ALIAS, "findById", new Object[] { id, dataQuery }, true, callback);
        }
예제 #11
0
        internal void FindByPrimaryKey <T>(T entity, DataQueryBuilder queryBuilder, AsyncCallback <T> callback)
        {
            if (entity == null)
            {
                throw new ArgumentException(ExceptionMessage.NULL_ENTITY);
            }

            if (queryBuilder == null)
            {
                queryBuilder = DataQueryBuilder.Create();
            }

            BackendlessDataQuery dataQuery = queryBuilder.Build();

            AddWeborbPropertyMapping <T>();
            Invoker.InvokeAsync(PERSISTENCE_MANAGER_SERVER_ALIAS, "findById", new Object[] { entity, queryBuilder }, true, callback);
        }
예제 #12
0
        internal T FindByPrimaryKey <T>(T entity, DataQueryBuilder queryBuilder)
        {
            if (entity == null)
            {
                throw new ArgumentException(ExceptionMessage.NULL_ENTITY);
            }

            if (queryBuilder == null)
            {
                queryBuilder = DataQueryBuilder.Create();
            }

            BackendlessDataQuery dataQuery = queryBuilder.Build();

            AddWeborbPropertyMapping <T>();
            return(Invoker.InvokeSync <T>(PERSISTENCE_MANAGER_SERVER_ALIAS, "findById",
                                          new Object[] { entity, dataQuery }, true));
        }
예제 #13
0
        public void GetObjectCount <T>(DataQueryBuilder dataQueryBuilder, AsyncCallback <int> callback)
        {
            var responder = new AsyncCallback <int>(r =>
            {
                if (callback != null)
                {
                    callback.ResponseHandler.Invoke(r);
                }
            }, f =>
            {
                if (callback != null)
                {
                    callback.ErrorHandler.Invoke(f);
                }
                else
                {
                    throw new BackendlessException(f);
                }
            });
            BackendlessDataQuery dataQuery = dataQueryBuilder.Build();

            Invoker.InvokeAsync <int>(PERSISTENCE_MANAGER_SERVER_ALIAS, "count",
                                      new object[] { GetTypeName(typeof(T)), dataQuery }, true, responder);
        }
예제 #14
0
 public void FindById(Dictionary <String, Object> entity, DataQueryBuilder queryBuilder, AsyncCallback <Dictionary <String, Object> > callback)
 {
     Invoker.InvokeAsync(PERSISTENCE_MANAGER_SERVER_ALIAS, "findById", new Object[] { tableName, entity, queryBuilder.Build() }, callback);
 }
예제 #15
0
 public Dictionary <String, Object> FindById(Dictionary <String, Object> entity, DataQueryBuilder queryBuilder)
 {
     return(Invoker.InvokeSync <Dictionary <String, Object> >(PERSISTENCE_MANAGER_SERVER_ALIAS, "findById", new Object[] { tableName, entity, queryBuilder.Build() }));
 }