當前位置: 首頁>>代碼示例>>Java>>正文


Java BmobQuery.setLimit方法代碼示例

本文整理匯總了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);
			}
		}
	});
}
 
開發者ID:tony-Shx,項目名稱:Swface,代碼行數:19,代碼來源:LoginActivity.java

示例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();
        }
    });
}
 
開發者ID:Break369,項目名稱:MyLife,代碼行數:19,代碼來源:main0fragment.java

示例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);
        }
    });
}
 
開發者ID:Break369,項目名稱:MyLife,代碼行數:23,代碼來源:main0fragment.java

示例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()));
            }
        }

    });
}
 
開發者ID:weimin96,項目名稱:shareNote,代碼行數:29,代碼來源:NetRequest.java

示例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()));
            }
        }
    });
}
 
開發者ID:weimin96,項目名稱:shareNote,代碼行數:29,代碼來源:NetRequest.java

示例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()));
            }
        }
    });
}
 
開發者ID:weimin96,項目名稱:shareNote,代碼行數:25,代碼來源:NetRequest.java

示例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();
            }
        }
    });
}
 
開發者ID:yiwent,項目名稱:Mobike,代碼行數:25,代碼來源:LoginActivity.java

示例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("信用積");
            }
        }
    });
}
 
開發者ID:yiwent,項目名稱:Mobike,代碼行數:18,代碼來源:UserActivity.java

示例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();
        }
    });
}
 
開發者ID:yiwent,項目名稱:Mobike,代碼行數:20,代碼來源:SettingsActivity.java

示例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);
            }
        }
    });
}
 
開發者ID:yiwent,項目名稱:Mobike,代碼行數:20,代碼來源:TestActivity.java

示例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);
        }
    });
}
 
開發者ID:JoeSteven,項目名稱:BiBi,代碼行數:26,代碼來源:CommentActivity.java

示例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()));
            }
        }
    });
}
 
開發者ID:xujiaji,項目名稱:HaiNaBaiChuan,代碼行數:28,代碼來源:NetRequest.java

示例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);
            }
        }
    });

}
 
開發者ID:razerdp,項目名稱:FriendCircle,代碼行數:19,代碼來源:MomentsRequest.java

示例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());
            }
        }
    });
}
 
開發者ID:junerver,項目名稱:CloudNote,代碼行數:23,代碼來源:NoteFragment.java

示例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);
    }
  });
}
 
開發者ID:bitkylin,項目名稱:BitkyShop,代碼行數:22,代碼來源:OrderManagerPresenter.java


注:本文中的cn.bmob.v3.BmobQuery.setLimit方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。