本文整理匯總了Java中cn.bmob.v3.BmobQuery.include方法的典型用法代碼示例。如果您正苦於以下問題:Java BmobQuery.include方法的具體用法?Java BmobQuery.include怎麽用?Java BmobQuery.include使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類cn.bmob.v3.BmobQuery
的用法示例。
在下文中一共展示了BmobQuery.include方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: findWeibos
import cn.bmob.v3.BmobQuery; //導入方法依賴的package包/類
private void findWeibos()
{
//MyUser user = BmobUser.getCurrentUser(LoginF.this, MyUser.class);
BmobQuery<Login> query = new BmobQuery<Login>();
//query.addWhereEqualTo("author", user); // 查詢當前用戶的所有微博
query.order("-updatedAt");
query.include("author");// 希望在查詢微博信息的同時也把發布人的信息查詢出來,可以使用include方法
query.findObjects(LoginF.this, new FindListener<Login>() {
@Override
public void onSuccess(List<Login> object)
{
// TODO Auto-generated method stub
weibos = object;
adapter.notifyDataSetChanged();
// mProgressDialog.dismiss();
}
@Override
public void onError(int code, String msg)
{
// TODO Auto-generated method stub
// toast("查詢失敗:" + msg);
}
});
//mProgressDialog = ProgressDialog.show(getActivity(), null, getResources().getString(R.string.del_));
}
示例2: findWeibos_
import cn.bmob.v3.BmobQuery; //導入方法依賴的package包/類
private void findWeibos_()
{
nico.styTool.MyUser user = BmobUser.getCurrentUser(this, nico.styTool.MyUser.class);
BmobQuery<Post_> query = new BmobQuery<Post_>();
query.addWhereEqualTo("author", user); // 查詢當前用戶的所有微博
query.order("-updatedAt");
query.include("author");// 希望在查詢微博信息的同時也把發布人的信息查詢出來,可以使用include方法
query.findObjects(this, new FindListener<Post_>() {
@Override
public void onSuccess(List<Post_> object)
{
// TODO Auto-generated method stub
weibos = object;
adapter.notifyDataSetChanged();
//et_content.setText("");
}
@Override
public void onError(int code, String msg)
{
// TODO Auto-generated method stub
//toast("查詢失敗:"+msg);
}
});
}
示例3: findComments
import cn.bmob.v3.BmobQuery; //導入方法依賴的package包/類
private void findComments()
{
BmobQuery<Comment_> query = new BmobQuery<Comment_>();
// pointer類型
query.addWhereEqualTo("post", new BmobPointer(weibo));
query.include("user,post.author");
query.findObjects(getActivity(), new FindListener<Comment_>() {
@Override
public void onSuccess(List<Comment_> object)
{
// TODO Auto-generated method stub
comments = object;
adapter.notifyDataSetChanged();
et_content.setText("");
}
@Override
public void onError(int code, String msg)
{
// TODO Auto-generated method stub
//toast("查詢失敗:"+msg);
}
});}
示例4: 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();
}
});
}
示例5: 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);
}
});
}
示例6: queryPersonActivity
import cn.bmob.v3.BmobQuery; //導入方法依賴的package包/類
/**
* 查詢我參與的活動
*/
private void queryPersonActivity() {
BmobQuery<MActivity> query = new BmobQuery<>();
query.addWhereEqualTo("currentUser",currentUser);
query.include("currentUser");
query.order("-createdAt");
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);
}
}
});
}
示例7: 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());
}
}
});
}
示例8: 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()));
}
}
});
}
示例9: 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());
}
}
});
}
示例10: queryRankList
import cn.bmob.v3.BmobQuery; //導入方法依賴的package包/類
private void queryRankList() {
BmobQuery<Rank> rankQuery = new BmobQuery<>();
rankQuery.include("no1,no2,no3,no4,no5,no6,no7,no8,no9,no10");
rankQuery.order("order");
rankQuery.findObjects(new FindListener<Rank>() {
@Override
public void done(List<Rank> list, BmobException e) {
if (e == null) {
if (rankList != null) {
rankList.clear();
}
rankList.addAll(list);
adapter.notifyDataSetChanged();
showToast("查詢成功!");
swipeRefreshLayout.setRefreshing(false);
} else {
showToast("查詢失敗!" + e.getErrorCode() + e.getMessage());
swipeRefreshLayout.setRefreshing(false);
}
}
});
}
示例11: 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()));
}
}
});
}
示例12: 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()));
}
}
});
}
示例13: pullReleasePost
import cn.bmob.v3.BmobQuery; //導入方法依賴的package包/類
/**
* 獲取該用戶發布的帖子
* @param currentIndex
* @param size
* @param listener
*/
public void pullReleasePost(int currentIndex, int size, final RequestListener<List<Post>> listener) {
if (!checkNet(listener)) return;
BmobQuery<Post> query = new BmobQuery<>();
query.addWhereEqualTo("author", BmobUser.getCurrentUser()); // 查詢當前用戶的所有帖子
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()));
}
}
});
}
示例14: 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()));
}
}
});
}
示例15: 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);
}
}
});
}