本文整理匯總了Java中cn.bmob.v3.BmobQuery.addWhereMatchesQuery方法的典型用法代碼示例。如果您正苦於以下問題:Java BmobQuery.addWhereMatchesQuery方法的具體用法?Java BmobQuery.addWhereMatchesQuery怎麽用?Java BmobQuery.addWhereMatchesQuery使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類cn.bmob.v3.BmobQuery
的用法示例。
在下文中一共展示了BmobQuery.addWhereMatchesQuery方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: 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());
}
}
});
}
示例2: 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());
}
}
});
}
示例3: requestFansNum
import cn.bmob.v3.BmobQuery; //導入方法依賴的package包/類
/**
* 請求獲取用戶粉絲數量
*/
public void requestFansNum(User user, final RequestListener<String> listener) {
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.count(User.class, new CountListener() {
@Override
public void done(Integer integer, BmobException e) {
if (e == null) {
listener.success(Integer.toString(integer));
} else {
listener.success("0");
}
}
});
}
示例4: 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()));
}
}
});
}
示例5: 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");
}
}
});
}
示例6: pullCollectPost
import cn.bmob.v3.BmobQuery; //導入方法依賴的package包/類
/**
* 獲取收藏/喜歡的帖子
*
* @param currentIndex
* @param size
* @param listener
*/
public void pullCollectPost(String userId, int currentIndex, int size, final RequestListener<List<Post>> listener) {
if (!checkNet(listener)) return;
BmobQuery<Post> query = new BmobQuery<>();
BmobQuery<User> innerQuery = new BmobQuery<>();
innerQuery.addWhereEqualTo("objectId", userId);
query.addWhereMatchesQuery("likes", "_User", innerQuery);
query.setSkip(currentIndex);
query.setLimit(size);
query.order("-createdAt");
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()));
}
}
});
}
示例7: pullCollectPost
import cn.bmob.v3.BmobQuery; //導入方法依賴的package包/類
/**
* 獲取收藏/喜歡的帖子
* @param currentIndex
* @param size
* @param listener
*/
public void pullCollectPost(String userId, int currentIndex, int size, final RequestListener<List<Post>> listener) {
if (!checkNet(listener)) return;
BmobQuery<Post> query = new BmobQuery<>();
BmobQuery<User> innerQuery = new BmobQuery<>();
innerQuery.addWhereEqualTo("objectId", userId);
query.addWhereMatchesQuery("likes", "_User", innerQuery);
query.setSkip(currentIndex);
query.setLimit(size);
query.order("-createdAt");
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()));
}
}
});
}
示例8: getData
import cn.bmob.v3.BmobQuery; //導入方法依賴的package包/類
/**
* 隻執行刷新操作,查詢當前用戶喜歡的活動
* 采用內部查詢的方法,來實現反查詢
*/
private void getData() {
BmobQuery<MActivity> query = new BmobQuery<>();
query.include("currentUser,collect");
query.order("-createdAt");
BmobQuery<BmobUser> innerQuery = new BmobQuery<>();
innerQuery.addWhereEqualTo("objectId",user.getObjectId());
query.addWhereMatchesQuery("collect","_User",innerQuery);
query.findObjects(new FindListener<MActivity>() {
@Override
public void done(List<MActivity> list, BmobException e) {
if (e == null) {
// 查出有數據
if (list.size() > 0) {
mActivities.clear();
mActivities.addAll(list);
activityAdapter.notifyDataSetChanged();
// 查詢到無數據
} else {
showToast("服務器沒有數據");
}
} else {
showToast("請求服務器異常" + e.getMessage() + "錯誤代碼" + e.getErrorCode());
Log.e("HHH", e.getMessage() + "錯誤代碼" + e.getErrorCode());
}
swipeRefreshLayout.setRefreshing(false);
}
});
}
示例9: getData
import cn.bmob.v3.BmobQuery; //導入方法依賴的package包/類
/**
* 隻執行刷新操作,查詢當前用戶喜歡的推文
* 采用內部查詢的方法,來實現反查詢
*/
private void getData() {
BmobQuery<Article> query = new BmobQuery<>();
query.include("collect");
query.order("-createdAt");
BmobQuery<User> innerQuery = new BmobQuery<>();
innerQuery.addWhereEqualTo("objectId",user.getObjectId());
query.addWhereMatchesQuery("collect","_User",innerQuery);
query.findObjects(new FindListener<Article>() {
@Override
public void done(List<Article> list, BmobException e) {
if (e == null) {
// 查出有數據
if (list.size() > 0) {
articles.clear();
articles.addAll(list);
articleAdapter.notifyDataSetChanged();
// 查詢到無數據
} else {
showToast("服務器沒有數據");
}
} else {
showToast("請求服務器異常" + e.getMessage() + "錯誤代碼" + e.getErrorCode());
Log.e("HHH", e.getMessage() + "錯誤代碼" + e.getErrorCode());
}
swipeRefreshLayout.setRefreshing(false);
}
});
}
示例10: queryFanUser
import cn.bmob.v3.BmobQuery; //導入方法依賴的package包/類
private void queryFanUser() {
BmobQuery<User> query = new BmobQuery<>();
query.include("focus");
BmobQuery<BmobUser> innerQuery = new BmobQuery<>();
innerQuery.addWhereEqualTo("objectId", user.getObjectId());
query.addWhereMatchesQuery("focus", "_User", innerQuery);
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();
} else {
showToast("服務器沒有數據");
}
swipeRefreshLayout.setRefreshing(false);
} else {
showToast("訪問服務器失敗,稍後重試" + e.getMessage() + e.getErrorCode());
swipeRefreshLayout.setRefreshing(false);
}
}
});
}
示例11: queryMyJoinedActivity
import cn.bmob.v3.BmobQuery; //導入方法依賴的package包/類
/**
* 查詢我參與的活動
*/
private void queryMyJoinedActivity(){
BmobQuery<MActivity> query = new BmobQuery<>();
query.include("currentUser,join");
query.order("-createdAt");
BmobQuery<User> innerQuery = new BmobQuery<>();
innerQuery.addWhereEqualTo("objectId",user.getObjectId());
query.addWhereMatchesQuery("join","_User",innerQuery);
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);
}
}
});
}
示例12: 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()));
}
}
});
// query.count(User.class, new CountListener() {
// @Override
// public void done(Integer integer, BmobException e) {
// if (e == null) {
// listener.success(Integer.toString(integer));
// } else {
// listener.success("0");
// }
// }
// });
}