本文整理汇总了Java中com.avos.avoscloud.AVQuery.find方法的典型用法代码示例。如果您正苦于以下问题:Java AVQuery.find方法的具体用法?Java AVQuery.find怎么用?Java AVQuery.find使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.avos.avoscloud.AVQuery
的用法示例。
在下文中一共展示了AVQuery.find方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getMoreNote
import com.avos.avoscloud.AVQuery; //导入方法依赖的package包/类
public static List<AVObject> getMoreNote(String user, int skip, int limit, boolean isFirst)
throws AVException {
AVQuery<AVObject> query = new AVQuery<>("Note");
query.whereEqualTo("user_tel", user);
query.orderByDescending("note_editedAt");
query.setLimit(limit);
query.setSkip(isFirst ? skip : 0);
return query.find();
}
示例2: findShots
import com.avos.avoscloud.AVQuery; //导入方法依赖的package包/类
public static List<Shot> findShots() {
// 查询当前Todo列表
AVQuery<Shot> query = AVQuery.getQuery(Shot.class);
// 按照更新时间降序排序
query.orderByDescending("updatedAt");
// 最大返回1000条
query.limit(1000);
try {
return query.find();
} catch (AVException exception) {
Log.e("tag", "Query todos failed.", exception);
return Collections.emptyList();
}
}
示例3: findNotes
import com.avos.avoscloud.AVQuery; //导入方法依赖的package包/类
public static List<Note> findNotes() {
AVQuery<Note> query = AVQuery.getQuery(Note.class);
query.orderByDescending("updatedAt");
query.limit(1000);
try {
return query.find();
} catch (AVException e) {
Log.e("tag", "Query notes failed.", e);
return Collections.emptyList();
}
}
示例4: findUsers
import com.avos.avoscloud.AVQuery; //导入方法依赖的package包/类
public static List<AVUser> findUsers(List<String> userIds) throws AVException {
if (userIds.size() <= 0) {
return Collections.EMPTY_LIST;
}
AVQuery<AVUser> q = AVUser.getQuery();
q.whereContainedIn("objectId", userIds);
q.setLimit(1000);
q.setCachePolicy(AVQuery.CachePolicy.NETWORK_ELSE_CACHE);
return q.find();
}
示例5: findAddRequests
import com.avos.avoscloud.AVQuery; //导入方法依赖的package包/类
public static List<AddRequest> findAddRequests() throws AVException {
AVUser user = AVUser.getCurrentUser();
AVQuery<AddRequest> q = AVObject.getQuery(AddRequest.class);
q.include(AddRequest.FROM_USER);
q.whereEqualTo(AddRequest.TO_USER, user);
q.orderByDescending("createdAt");
q.setCachePolicy(AVQuery.CachePolicy.NETWORK_ELSE_CACHE);
return q.find();
}
示例6: getUserFolders
import com.avos.avoscloud.AVQuery; //导入方法依赖的package包/类
public static List<AVObject> getUserFolders(String user) throws AVException {
AVQuery<AVObject> query = new AVQuery<>("Folder");
query.whereEqualTo("user_tel", user);
query.orderByAscending("createdAt");
return query.find();
}
示例7: getUserNote
import com.avos.avoscloud.AVQuery; //导入方法依赖的package包/类
public static List<AVObject> getUserNote(String user) throws AVException {
AVQuery<AVObject> query = new AVQuery<>("Note");
query.whereEqualTo("user_tel", user);
query.orderByDescending("note_editedAt");
return query.find();
}
示例8: doInBackground
import com.avos.avoscloud.AVQuery; //导入方法依赖的package包/类
@Override
protected Boolean doInBackground(Void... params) {
AVQuery<AVObject> query = new AVQuery<AVObject>(
"Comments");
query.whereEqualTo("vid", mAnimation.AnimationId);
query.setLimit(mStep);
query.setSkip(mSkip);
query.include("uid");
query.orderByDescending("updatedAt");
try {
List<AVObject> commentList = query.find();
if (commentList.size() < mStep) {
mCommentFinished = true;
}
ArrayList<LinearLayout> commentsLayout = new ArrayList<LinearLayout>();
for (AVObject comment : commentList) {
AVObject user = comment.getAVObject("uid");
Comment commentInformation = new Comment(
user.getString("username"),
user.getString("avatar"),
user.getString("platform"), comment.getUpdatedAt(),
comment.getString("content"));
LinearLayout commentItem = (LinearLayout) mLayoutInflater
.inflate(R.layout.comment_item, null);
TextView content = (TextView) commentItem
.findViewById(R.id.content);
content.setText(commentInformation.Content);
ImageView avatar = (ImageView) commentItem
.findViewById(R.id.avatar);
Picasso.with(mContext).load(commentInformation.Avatar)
.into(avatar);
TextView username = (TextView) commentItem
.findViewById(R.id.name);
username.setText(commentInformation.Username);
TextView date = (TextView) commentItem
.findViewById(R.id.time);
date.setText(mPrettyTime.format(commentInformation.Date));
commentsLayout.add(commentItem);
}
mSkip += mStep;
mCommentCount += commentList.size();
publishProgress(commentsLayout
.toArray(new LinearLayout[commentList.size()]));
return true;
} catch (AVException e) {
return false;
}
}