本文整理匯總了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);
}
});
}