当前位置: 首页>>代码示例>>Java>>正文


Java BmobQuery.findObjects方法代码示例

本文整理汇总了Java中cn.bmob.v3.BmobQuery.findObjects方法的典型用法代码示例。如果您正苦于以下问题:Java BmobQuery.findObjects方法的具体用法?Java BmobQuery.findObjects怎么用?Java BmobQuery.findObjects使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在cn.bmob.v3.BmobQuery的用法示例。


在下文中一共展示了BmobQuery.findObjects方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getPostComment

import cn.bmob.v3.BmobQuery; //导入方法依赖的package包/类
/**
 * 获取文章的评论
 */
public void getPostComment(String postId, final RequestListener<List<Comment>> listener) {
    if (!checkNet(listener)) return;
    BmobQuery<Comment> query = new BmobQuery<>();
    Post post = new Post();
    post.setObjectId(postId);
    query.addWhereEqualTo("post", new BmobPointer(post));
    query.include("user");
    query.order("-createdAt");
    query.findObjects(new FindListener<Comment>() {
        @Override
        public void done(List<Comment> list, BmobException e) {
            if (e == null) {
                listener.success(list);
            }
        }
    });
}
 
开发者ID:weimin96,项目名称:shareNote,代码行数:21,代码来源:NetRequest.java

示例2: queryUserInfo

import cn.bmob.v3.BmobQuery; //导入方法依赖的package包/类
/**
 * 查询指定用户信息
 *
 * @param objectId
 * @param listener
 */
public static void queryUserInfo(String objectId, final BmobEvent.QueryUserListener listener) {
    BmobQuery<User> query = new BmobQuery<>();
    query.addWhereEqualTo("objectId", objectId);
    query.findObjects(
            new FindListener<User>() {
                @Override
                public void done(List<User> list, BmobException e) {
                    if (e == null) {

                        if (list != null && list.size() > 0) {
                            listener.done(list.get(0), null);
                        } else {
                            listener.done(null, new BmobException(000, "查无此人"));
                        }
                    } else {
                        listener.done(null, e);
                    }
                }
            });
}
 
开发者ID:InnoFang,项目名称:FamilyBond,代码行数:27,代码来源:BmobUtil.java

示例3: startSearchUser

import cn.bmob.v3.BmobQuery; //导入方法依赖的package包/类
private void startSearchUser(final String username, final String password) {
	BmobQuery<UserLogin> query = new BmobQuery<>();
	query.addWhereEqualTo("username", username);
	query.setLimit(1);
	query.findObjects(new FindListener<UserLogin>() {
		@Override
		public void done(List<UserLogin> list, BmobException e) {
			if (e == null && !list.isEmpty()) {
				startLogin(list.get(0));
			} else if (e == null) {
				startRegister(username, password);
			} else {
				showNormalDia("温馨提示", "登录失败!请检查网络连接");
				Log.e(TAG, "query.findObjects: ", e);
			}
		}
	});
}
 
开发者ID:tony-Shx,项目名称:Swface,代码行数:19,代码来源:LoginActivity.java

示例4: refresh

import cn.bmob.v3.BmobQuery; //导入方法依赖的package包/类
public void refresh() {
    BmobQuery<Order> queryData = new BmobQuery<Order>();
    queryData.setLimit(15);
    queryData.include("user");
    queryData.findObjects(getActivity(), new FindListener<Order>() {
        @Override
        public void onSuccess(List<Order> list) {
            if (list != null) {
                mLists.clear();
                mLists.addAll(list);
                Toast.makeText(getActivity(), "刷新成功", Toast.LENGTH_SHORT).show();
                myItemAdapter.updateItems(mLists);
                refreshLayout.setRefreshing(false);
            }
        }
        @Override
        public void onError(int i, String s) {
            Toast.makeText(getActivity(), "网络出错", Toast.LENGTH_SHORT).show();
            refreshLayout.setRefreshing(false);
        }
    });
}
 
开发者ID:Break369,项目名称:MyLife,代码行数:23,代码来源:main0fragment.java

示例5: queryBlackList

import cn.bmob.v3.BmobQuery; //导入方法依赖的package包/类
/**
 * 查询黑名单用户
 *
 * @param callback 回调
 */
private void queryBlackList(final FindListener<User> callback) {
        BmobQuery<User> query = new BmobQuery<>();
        query.order("updateAt");
        query.addWhereRelatedTo(COLUMN_NAME_BLACKLIST, new BmobPointer(getCurrentUser()));
        query.findObjects(CustomApplication.getInstance(), new FindListener<User>() {
                        @Override
                        public void onSuccess(List<User> list) {
                                callback.onSuccess(list);
                        }

                        @Override
                        public void onError(int i, String s) {
                                callback.onError(i, s);
                        }
                }
        );
}
 
开发者ID:HelloChenJinJun,项目名称:TestChat,代码行数:23,代码来源:UserManager.java

示例6: queryJoinedUser

import cn.bmob.v3.BmobQuery; //导入方法依赖的package包/类
private void queryJoinedUser() {
        BmobQuery<User> query = new BmobQuery<>();
        query.addWhereRelatedTo("join", new BmobPointer(mActivity));
        query.findObjects(new FindListener<User>() {
            @Override
            public void done(List<User> list, BmobException e) {
                if (e == null) {
                    if (list.size() > 0) {
                        if (users != null) {
                            users.clear();
                        }
                        users.addAll(list);
                        adapter.notifyDataSetChanged();
//                        并设置人数
                        joinedNum.setText(list.size() + "");
                    } else {
                        showToast("服务器没有数据");
                    }
                    swipeRefreshLayout.setRefreshing(false);
                } else {
                    showToast("访问服务器失败,稍后重试" + e.getMessage() + e.getErrorCode());
                    swipeRefreshLayout.setRefreshing(false);
                }
            }
        });
    }
 
开发者ID:HowieTianDev,项目名称:ChenYan,代码行数:27,代码来源:JoinedUserActivity.java

示例7: pullReleasePost

import cn.bmob.v3.BmobQuery; //导入方法依赖的package包/类
/**
 * 获取该用户发布的帖子
 *
 * @param currentIndex
 * @param size
 * @param listener
 */
public void pullReleasePost(String userId, int currentIndex, int size, final RequestListener<List<Post>> listener) {
    if (!checkNet(listener)) return;
    BmobQuery<Post> query = new BmobQuery<>();

    query.addWhereEqualTo("author", userId);    // 查询当前用户的所有帖子
    query.setSkip(currentIndex);
    query.setLimit(size);
    query.order("-updatedAt");
    query.include("author");// 希望在查询帖子信息的同时也把发布人的信息查询出来
    query.findObjects(new FindListener<Post>() {
        @Override
        public void done(List<Post> list, BmobException e) {
            if (e == null) {
                listener.success(list);
            } else {
                listener.error(ErrMsgFactory.errMSG(e.getErrorCode()));
            }
        }

    });
}
 
开发者ID:weimin96,项目名称:shareNote,代码行数:29,代码来源:NetRequest.java

示例8: cheackUser

import cn.bmob.v3.BmobQuery; //导入方法依赖的package包/类
private void cheackUser() {
    BmobQuery<MyUser> query = new BmobQuery<MyUser>();
    query.addWhereEqualTo("username", "182****2002");
    query.setLimit(1);
    query.findObjects(new FindListener<MyUser>() {
        @Override
        public void done(List<MyUser> list, BmobException e) {
            if (e == null) {
                if (list.size() > 0 && list != null) {
                    Log.d(TAG, "cheackUser: ok");
                } else {
                    Log.d(TAG, "cheackUser: not");
                }
            } else {
                Log.d(TAG, "done: " + e);
            }
        }
    });
}
 
开发者ID:yiwent,项目名称:Mobike,代码行数:20,代码来源:TestActivity.java

示例9: putToRefreshByUnit

import cn.bmob.v3.BmobQuery; //导入方法依赖的package包/类
/**
 * “单元”列表下拉刷新具体实现
 */
private void putToRefreshByUnit() {
    //初始化Bmob查询类
    BmobQuery<Unit> query = new BmobQuery<>();
    //执行查询,查询单元表 取出所有单元
    query.findObjects(getContext(), new FindListener<Unit>() {
        @Override
        public void onSuccess(final List<Unit> unitList) {
            //根据查询的所有单元,请求所有的知识点数据
            requestPointByUnits(unitList);
        }
        @Override
        public void onError(int i, String s) {
            toastError(mLoadingLayout, getContext());
        }
    });

}
 
开发者ID:FallenCrood,项目名称:Review-,代码行数:21,代码来源:ReviewFragment.java

示例10: synvToDb

import cn.bmob.v3.BmobQuery; //导入方法依赖的package包/类
public void synvToDb() {
    BmobQuery<Note> query = new BmobQuery<Note>();
    query.addWhereEqualTo("userObjId", BmobUser.getCurrentUser().getUsername());
    query.setLimit(50); //查询本用户的50条笔记
    query.findObjects(new FindListener<Note>() {
        @Override
        public void done(List<Note> list, BmobException e) {
            if (e == null) {
                Logger.d("共查询到:" + list.size());
                for (Note note : list) {
                    NoteEntity entity = note.toEntity();
                    entity.setObjId(note.getObjectId());
                    CloudNoteApp.getNoteEntityDao().insertOrReplace(entity);
                }
                NotesFromDatabaseObservable.ofDate()
                        .subscribe(NoteFragment.this);
            } else {
                Logger.d("bmob查询失败:" + e.getMessage() + "," + e.getErrorCode());
            }
        }
    });
}
 
开发者ID:junerver,项目名称:CloudNote,代码行数:23,代码来源:NoteFragment.java

示例11: showCommentMessage

import cn.bmob.v3.BmobQuery; //导入方法依赖的package包/类
private void showCommentMessage(final PushMessage msg) {
    BmobQuery<Comment> query=new BmobQuery<Comment>();
    query.addWhereEqualTo("objectId", msg.alert);
    query.findObjects(context, new FindListener<Comment>() {
        @Override
        public void onSuccess(List<Comment> list) {
            if(list.size()>0){
                Comment comment=list.get(0);
                Log.d("BB",comment.getContent());
                if(application.isCommentAllowed)
                {
                    showNotification(context, comment,msg.tag);
                }
            }

        }

        @Override
        public void onError(int i, String s) {

        }
    });
}
 
开发者ID:JoeSteven,项目名称:BiBi,代码行数:24,代码来源:MyPushReceiver.java

示例12: queryCurrentOrderFromBmob

import cn.bmob.v3.BmobQuery; //导入方法依赖的package包/类
/**
 *
 */
private void queryCurrentOrderFromBmob() {
  BmobQuery<Order> bmobQuery = new BmobQuery<>();
  bmobQuery.addWhereEqualTo("objectId", order.getObjectId());
  bmobQuery.findObjects(new FindListener<Order>() {

    @Override public void done(List<Order> list, BmobException e) {
      if (e != null) {
        toastUtil.show(e.getMessage());
        return;
      }
      if (list.size() > 0) {
        order = list.get(0);
        initOrder(order);
      }
    }
  });
}
 
开发者ID:bitkylin,项目名称:BitkyShop,代码行数:21,代码来源:OrderActivity.java

示例13: findAllMoments

import cn.bmob.v3.BmobQuery; //导入方法依赖的package包/类
public void findAllMoments(final SimpleResponseListener simpleResponseListener) {
    BmobQuery<MomentsInfo> momentQuery = new BmobQuery<>();
    momentQuery.order("-createdAt");
    momentQuery.findObjects(new FindListener<MomentsInfo>() {
        @Override
        public void done(List<MomentsInfo> list, BmobException e) {
            if (e == null) {
                if (momentsList == null) {
                    momentsList = new ArrayList<MomentsInfo>();
                }
                momentsList.clear();
                momentsList.addAll(list);
                if (simpleResponseListener != null) {
                    simpleResponseListener.onSuccess("成功", 0);
                }
            }
        }
    });
}
 
开发者ID:razerdp,项目名称:FriendCircle,代码行数:20,代码来源:BmobInitHelper.java

示例14: getWelcomePic

import cn.bmob.v3.BmobQuery; //导入方法依赖的package包/类
public void getWelcomePic(final WelcomeActivity context) {
    BmobQuery<Wel> bmobQuery = new BmobQuery<>();
    bmobQuery.addWhereEqualTo("imgDate", OtherUtils.currDay());
    bmobQuery.findObjects(new FindListener<Wel>() {
        @Override
        public void done(List<Wel> list, BmobException e) {
            if (list == null) {
                return;
            }
            LogUtil.e3("list.size() = " + list.size());
            for (int i = 0; i < list.size(); i++) {
                LogUtil.e3(list.get(i).toString());
                break;
            }
        }
    });
}
 
开发者ID:xujiaji,项目名称:HaiNaBaiChuan,代码行数:18,代码来源:NetRequest.java

示例15: findThisBook

import cn.bmob.v3.BmobQuery; //导入方法依赖的package包/类
private void findThisBook()
{
	BmobQuery<Book> query1 = new BmobQuery<Book>();
	query1.addWhereEqualTo("name", books.getName());
	query1.addWhereEqualTo("autor", books.getAutor());
	query1.findObjects(AddBook.this, new FindListener<Book>() {
        @Override
        public void onSuccess(List<Book> object) {
            // TODO Auto-generated method stub
            //toast("查询成功:共"+object.size()+"条数据。");
        	bookId = object.get(0).getObjectId();
        	Toast.makeText(AddBook.this, bookId+"", Toast.LENGTH_SHORT).show();
        	//添加记录
			RecordBook recordBook = new RecordBook(new BmobDate(new Date()), "录入", mUser.getAddrs()+" "+mUser.getUsername(),bookId);
			AddBookRecordUtil.addTherecord(AddBook.this, recordBook);
        }
        @Override
        public void onError(int code, String msg) {
            // TODO Auto-generated method stub
           // toast("查询失败:"+msg);
        }
});
}
 
开发者ID:letourfrance,项目名称:RadarLibrary,代码行数:24,代码来源:AddBook.java


注:本文中的cn.bmob.v3.BmobQuery.findObjects方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。