本文整理汇总了Java中cn.bmob.v3.BmobQuery.addWhereEqualTo方法的典型用法代码示例。如果您正苦于以下问题:Java BmobQuery.addWhereEqualTo方法的具体用法?Java BmobQuery.addWhereEqualTo怎么用?Java BmobQuery.addWhereEqualTo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cn.bmob.v3.BmobQuery
的用法示例。
在下文中一共展示了BmobQuery.addWhereEqualTo方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: refreshData
import cn.bmob.v3.BmobQuery; //导入方法依赖的package包/类
public void refreshData() {
BmobQuery<ChannelSigner> channelQuery = new BmobQuery<ChannelSigner>();
channelQuery.addWhereEqualTo(ChannelSigner.CHANNEL_KEY, mChannel.getObjectId());
channelQuery.addWhereGreaterThanOrEqualTo(ChannelSigner.SIGN_DATE_KEY, mChannel.getStartSignDate());
channelQuery.include(String.format("%1$s,%2$s",
ChannelSigner.SIGNER_KEY,
ChannelSigner.CHANNEL_KEY));
channelQuery.setLimit(Constants.QUERY_MAX_NUMBER);
channelQuery.order(ChannelSigner.SIGNER_KEY);
channelQuery.findObjects(mContext, new FindListener<ChannelSigner>() {
@Override
public void onSuccess(List<ChannelSigner> channelSigners) {
mChannelSignerAdapter.clear();
mChannelSignerAdapter.addAll(channelSigners);
mPullToRefreshLayout.refreshFinish(PullToRefreshLayout.SUCCEED);
}
@Override
public void onError(int arg0, String msg) {
mPullToRefreshLayout.refreshFinish(PullToRefreshLayout.FAIL);
}
});
}
示例2: findComments
import cn.bmob.v3.BmobQuery; //导入方法依赖的package包/类
private void findComments()
{
BmobQuery<Comment_> query = new BmobQuery<Comment_>();
// pointer类型
query.addWhereEqualTo("post", new BmobPointer(weibo));
query.include("user,post.author");
query.findObjects(getActivity(), new FindListener<Comment_>() {
@Override
public void onSuccess(List<Comment_> object)
{
// TODO Auto-generated method stub
comments = object;
adapter.notifyDataSetChanged();
et_content.setText("");
}
@Override
public void onError(int code, String msg)
{
// TODO Auto-generated method stub
//toast("查询失败:"+msg);
}
});}
示例3: requestFans
import cn.bmob.v3.BmobQuery; //导入方法依赖的package包/类
/**
* 请求获取用户粉丝
*/
public void requestFans(User user, final RequestListener<List<User>> listener) {
if (!checkNet(listener)) return;
BmobQuery<User> query = new BmobQuery<User>();
BmobQuery<User> innerQuery = new BmobQuery<>();
innerQuery.addWhereEqualTo("objectId", user.getObjectId());
// query.addQueryKeys("followPerson");
query.addWhereMatchesQuery("followPerson", "_User", innerQuery);
query.findObjects(new FindListener<User>() {
@Override
public void done(List<User> list, BmobException e) {
if (e == null) {
listener.success(list);
} else {
listener.error(ErrMsgFactory.errMSG(e.getErrorCode()));
}
}
});
}
示例4: 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);
}
}
});
}
示例5: queryFanNum
import cn.bmob.v3.BmobQuery; //导入方法依赖的package包/类
/**
* 查询粉丝数目
*/
private void queryFanNum(User user) {
BmobQuery<User> query = new BmobQuery<>();
query.include("focus");
BmobQuery<BmobUser> innerQuery = new BmobQuery<>();
innerQuery.addWhereEqualTo("objectId", user.getObjectId());
query.addWhereMatchesQuery("focus", "_User", innerQuery);
query.count(User.class, new CountListener() {
@Override
public void done(Integer integer, BmobException e) {
if (e == null) {
tvFan.setText(integer.toString());
} else {
showToast("查询粉丝数目失败" + e.getErrorCode() + e.getMessage());
}
}
});
}
示例6: queryPersonActivity
import cn.bmob.v3.BmobQuery; //导入方法依赖的package包/类
/**
* 查询我参与的活动
*/
private void queryPersonActivity() {
BmobQuery<MActivity> query = new BmobQuery<>();
query.addWhereEqualTo("currentUser",currentUser);
query.include("currentUser");
query.order("-createdAt");
query.findObjects(new FindListener<MActivity>() {
@Override
public void done(List<MActivity> list, BmobException e) {
if (e == null) {
if (list.size() > 0) {
activities.clear();
activities.addAll(list);
activityAdapter.notifyDataSetChanged();
} else {
showToast("服务器没有数据");
}
swipeRefreshLayout.setRefreshing(false);
} else {
showToast("请求服务器失败,请稍后重试" + e.getMessage() + e.getErrorCode());
swipeRefreshLayout.setRefreshing(false);
}
}
});
}
示例7: queryFanNum
import cn.bmob.v3.BmobQuery; //导入方法依赖的package包/类
/**
* 查询粉丝数目
*/
private void queryFanNum() {
BmobQuery<User> query = new BmobQuery<>();
query.include("focus");
BmobQuery<BmobUser> innerQuery = new BmobQuery<>();
innerQuery.addWhereEqualTo("objectId", dynamicAuthor.getObjectId());
query.addWhereMatchesQuery("focus", "_User", innerQuery);
query.count(User.class, new CountListener() {
@Override
public void done(Integer integer, BmobException e) {
if (e == null) {
tvFan.setText(integer.toString());
} else {
showToast("查询粉丝数目失败" + e.getErrorCode() + e.getMessage());
}
}
});
}
示例8: requestCollectNum
import cn.bmob.v3.BmobQuery; //导入方法依赖的package包/类
/**
* 请求获取用户喜欢的文章数量
*/
public void requestCollectNum(User user, final RequestListener<String> listener) {
BmobQuery<Post> query = new BmobQuery<>();
BmobQuery<User> innerQuery = new BmobQuery<>();
innerQuery.addWhereEqualTo("objectId", user.getObjectId());
// query.addQueryKeys("followPerson");
query.addWhereMatchesQuery("likes", "_User", innerQuery);
query.count(Post.class, new CountListener() {
@Override
public void done(Integer integer, BmobException e) {
if (e == null) {
listener.success(Integer.toString(integer));
} else {
listener.success("0");
}
}
});
}
示例9: Check4CloudContacts
import cn.bmob.v3.BmobQuery; //导入方法依赖的package包/类
/**
* 检查联系人列表中有那些人是云端联系人,如果是则获取云联系人的显示名
* 因为contactInfo 是可变类型,所以这里没有返回值
* <p>
* <p>
* <p>
* 我们推荐您使用真实的头像,那样您的联系人就能更快的确定您的身份
*
* @param contacts
*/
public static void Check4CloudContacts(List<ContactInfo> contacts, Context context) {
BmobQuery<BmobBaseUser> query;
for (final ContactInfo contact : contacts) {
query = new BmobQuery<>();
query.addWhereEqualTo("phone_number", contact.getNumber()); // 根据当前联系人列表查询网络端的云联系人
query.findObjects(context, new FindListener<BmobBaseUser>() {
@Override
public void onSuccess(List<BmobBaseUser> list) {
if (list.size() > 0) { // 云端由此联系人
BmobBaseUser cloudContacts = list.get(0);
contact.setOnCloud(true);
contact.setDisplayName(cloudContacts.getNickName());
// TODO: 2016/5/11 获取云端联系人头像
cloudContacts.getProfileUrl();
}
}
@Override
public void onError(int i, String s) {
}
});
}
}
示例10: 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) {
}
});
}
示例11: searchCommodity
import cn.bmob.v3.BmobQuery; //导入方法依赖的package包/类
private void searchCommodity() {
((InputMethodManager) context.getSystemService(
Context.INPUT_METHOD_SERVICE)).hideSoftInputFromWindow(searchEdittext.getWindowToken(),
InputMethodManager.HIDE_NOT_ALWAYS);
String msg = searchEdittext.getText().toString().trim();
if (msg.equals("")) {
toastUtil.show("请输入要搜索的商品");
return;
}
BmobQuery<Commodity> bmobQuery = new BmobQuery<>();
bmobQuery.addWhereEqualTo("categorySub", msg);
KLog.d(msg);
bmobQuery.findObjects(new FindListener<Commodity>() {
@Override public void done(List<Commodity> list, BmobException e) {
if (e != null) {
KLog.d(e.getMessage());
}
if (list != null) {
KLog.d(list.size());
}
}
});
}
示例12: pushComment
import cn.bmob.v3.BmobQuery; //导入方法依赖的package包/类
private void pushComment() {
BmobQuery<BBUser> idQuery=new BmobQuery<BBUser>();
idQuery.addWhereEqualTo("username", mUserName);
idQuery.findObjects(this, new FindListener<BBUser>() {
@Override
public void onSuccess(List<BBUser> list) {
if (list.size() > 0) {
setReceiverId(list.get(0).getInstallId());
}
}
@Override
public void onError(int i, String s) {
}
});
}
示例13: searchUser
import cn.bmob.v3.BmobQuery; //导入方法依赖的package包/类
public static void searchUser(Context context, String key, String value) {
BmobQuery<BmobUser> query = new BmobQuery<BmobUser>();
query.addWhereEqualTo(key, value);
query.findObjects(context, new FindListener<BmobUser>() {
@Override
public void onSuccess(List<BmobUser> list) {
if (list.isEmpty()) {
mState.getState(MODE_SEARCH_USER, false);
} else {
mState.getState(MODE_SEARCH_USER, true);
}
}
@Override
public void onError(int i, String s) {
}
});
}
示例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;
}
}
});
}
示例15: queryOrderFormBmob
import cn.bmob.v3.BmobQuery; //导入方法依赖的package包/类
public void queryOrderFormBmob(String objectId, int status) {
userObjectId = objectId;
this.status = status;
BmobQuery<Order> bmobQuery = new BmobQuery<>();
bmobQuery.addWhereEqualTo("userObjectId", objectId);
if (status != Order.NONE) {
bmobQuery.addWhereEqualTo("status", status);
}
bmobQuery.order("-createdAt");
bmobQuery.setLimit(countLimit);
bmobQuery.findObjects(new FindListener<Order>() {
@Override public void done(List<Order> list, BmobException e) {
if (e != null) {
activity.showMessage("您还没有买过东西!");
return;
}
activity.initCloudOrder(list);
}
});
}