本文整理汇总了Java中cn.bmob.v3.BmobQuery.setLimit方法的典型用法代码示例。如果您正苦于以下问题:Java BmobQuery.setLimit方法的具体用法?Java BmobQuery.setLimit怎么用?Java BmobQuery.setLimit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cn.bmob.v3.BmobQuery
的用法示例。
在下文中一共展示了BmobQuery.setLimit方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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);
}
}
});
}
示例2: query
import cn.bmob.v3.BmobQuery; //导入方法依赖的package包/类
public void query() {
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 = list;
myItemAdapter.updateItems(mLists);
}
}
@Override
public void onError(int i, String s) {
Toast.makeText(getActivity(), "查询失败", Toast.LENGTH_SHORT).show();
}
});
}
示例3: 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);
}
});
}
示例4: 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()));
}
}
});
}
示例5: 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()));
}
}
});
}
示例6: pullPostList
import cn.bmob.v3.BmobQuery; //导入方法依赖的package包/类
/**
* 获取帖子数据集合
*
* @param size 获取的数据条数
* @return
*/
public void pullPostList(int currentIndex, int size, final RequestListener<List<Post>> listener) {
if (!checkNet(listener)) return;
BmobQuery<Post> query = new BmobQuery<>();
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: RegOK
import cn.bmob.v3.BmobQuery; //导入方法依赖的package包/类
private void RegOK() {
mDialog.show();
mPhone = mEtPhone.getText().toString().trim().replace("\\s*", "");// TODO: 2017/6/21 测试后删除
BmobQuery<MyUser> query = new BmobQuery<MyUser>();
query.addWhereEqualTo("username", mPhone);
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");
toLogin();
} else {
Log.d(TAG, "cheackUser: notRegister");
toRegister();
}
} else {
Log.d(TAG, "done: " + e);
DismissMyDialog();
}
}
});
}
示例8: requestCredit
import cn.bmob.v3.BmobQuery; //导入方法依赖的package包/类
private void requestCredit() {
BmobQuery<Credit> credit = new BmobQuery<Credit>();
credit.addWhereEqualTo("mMyUser", myUser);
credit.setLimit(1);
credit.findObjects(new FindListener<Credit>() {
@Override
public void done(List<Credit> list, BmobException e) {
if (e == null && list != null) {
Credit cr = list.get(0);
mTvCredit.setText("信用积分" + cr.getCreditNub() + "");
} else {
Log.d(TAG, "done: Credit" + e);
mTvCredit.setText("信用积");
}
}
});
}
示例9: findNew
import cn.bmob.v3.BmobQuery; //导入方法依赖的package包/类
private void findNew() {
mDialog.show();
BmobQuery<VersionInfo> query = new BmobQuery<>("VersionInfo");
query.order("-updatedAt");
query.setLimit(1);//最新1条
query.findObjects(new FindListener<VersionInfo>() {
@Override
public void done(List<VersionInfo> list, BmobException e) {
if (e == null && !list.isEmpty()) {
dismissDialog();
chackVersion(list.get(0));
} else {
ToastUtils.show(SettingsActivity.this, "检查新版本失败");
Logger.d(e);
}
dismissDialog();
}
});
}
示例10: 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);
}
}
});
}
示例11: setReceiverId
import cn.bmob.v3.BmobQuery; //导入方法依赖的package包/类
private void setReceiverId(String installId) {
//所有要接收通知的对象
final List<String> receivers=new ArrayList<String>();
String installationId =installId;
receivers.add(installationId);
BmobQuery<Follow> followBmobQuery=new BmobQuery<Follow>();
followBmobQuery.addWhereEqualTo("debateId", comment.getBelongTo());
followBmobQuery.setLimit(100000);
followBmobQuery.findObjects(this, new FindListener<Follow>() {
@Override
public void onSuccess(List<Follow> list) {
if (list.size() > 0) {
for (Follow f : list) {
receivers.add(f.getFollowerInstallationId());
}
}
pushCommit(receivers);
}
@Override
public void onError(int i, String s) {
pushCommit(receivers);
}
});
}
示例12: 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()));
}
}
});
}
示例13: executeInternal
import cn.bmob.v3.BmobQuery; //导入方法依赖的package包/类
@Override
protected void executeInternal(final int requestType, boolean showDialog) {
BmobQuery<MomentsInfo> query = new BmobQuery<>();
query.order("-createdAt");
query.include(MomentsFields.AUTHOR_USER + "," + MomentsFields.HOST);
query.setLimit(count);
query.setSkip(curPage * count);
query.setCachePolicy(isFirstRequest? BmobQuery.CachePolicy.CACHE_ELSE_NETWORK: BmobQuery.CachePolicy.NETWORK_ELSE_CACHE);
query.findObjects(new FindListener<MomentsInfo>() {
@Override
public void done(List<MomentsInfo> list, BmobException e) {
if (!ToolUtil.isListEmpty(list)) {
queryCommentAndLikes(list);
}
}
});
}
示例14: 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());
}
}
});
}
示例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);
}
});
}