本文整理匯總了Java中cn.bmob.v3.BmobQuery.count方法的典型用法代碼示例。如果您正苦於以下問題:Java BmobQuery.count方法的具體用法?Java BmobQuery.count怎麽用?Java BmobQuery.count使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類cn.bmob.v3.BmobQuery
的用法示例。
在下文中一共展示了BmobQuery.count方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: 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");
}
}
});
}
示例5: requestFocusNum
import cn.bmob.v3.BmobQuery; //導入方法依賴的package包/類
/**
* 請求獲取用戶關注其他用戶數量
*/
public void requestFocusNum(User user, final RequestListener<String> listener) {
BmobQuery<User> query = new BmobQuery<>();
query.addWhereRelatedTo("followPerson", new BmobPointer(user));
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");
}
}
});
}
示例6: requestMyCouponsData
import cn.bmob.v3.BmobQuery; //導入方法依賴的package包/類
private void requestMyCouponsData() {
BmobQuery<MyCouponsData> count = new BmobQuery<MyCouponsData>();
count.addWhereEqualTo("mMyUser", myUser);
count.count(MyCouponsData.class, new CountListener() {
@Override
public void done(Integer integer, BmobException e) {
if (e == null && integer != 0) {
mTvMyYouhui.setRigtTvText(integer + "張");
} else {
mTvMyYouhui.setRigtTvText("");
Log.d(TAG, "done:MyCouponsData " + e);
}
}
});
}