本文整理汇总了Java中com.parse.ParseQuery类的典型用法代码示例。如果您正苦于以下问题:Java ParseQuery类的具体用法?Java ParseQuery怎么用?Java ParseQuery使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ParseQuery类属于com.parse包,在下文中一共展示了ParseQuery类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: localQuery
import com.parse.ParseQuery; //导入依赖的package包/类
private void localQuery(){
ParseQuery<Kid> lQuery = ParseQuery.getQuery(Kid.class).fromLocalDatastore();
lQuery.orderByAscending("createdAt");
lQuery.findInBackground(new FindCallback<Kid>() {
@Override
public void done(List<Kid> list, ParseException e) {
if (e == null) {
kidArrayList.clear();
kidArrayList.addAll(list);
fillHashMap();
adapter = new AddAttendanceAdapter(AddAttendance.this,kidArrayList,activityMap);
listView.setAdapter(adapter);
listView.invalidate();
}
}
});
}
示例2: localQuery
import com.parse.ParseQuery; //导入依赖的package包/类
private void localQuery(){
ParseQuery<Kid> query = ParseQuery.getQuery(Kid.class).fromLocalDatastore();
query.orderByAscending("createdAt");
query.findInBackground(new FindCallback<Kid>() {
@Override
public void done(List<Kid> list, @Nullable ParseException e) {
if (e == null && list.size()!=0) {
kidArrayList.clear();
kidArrayList.addAll(list);
applyAttendanceToKids();
adapter.notifyDataSetChanged();
listView.invalidate();
}
}
});
}
示例3: serverQuery
import com.parse.ParseQuery; //导入依赖的package包/类
private void serverQuery() {
ParseQuery<Kid> query = ParseQuery.getQuery(Kid.class);
query.orderByAscending("createdAt");
query.findInBackground(new FindCallback<Kid>() {
@Override
public void done(List<Kid> list, @Nullable ParseException e) {
if (e == null){
kidArrayList.clear();
kidArrayList.addAll(list);
Kid.pinAllInBackground(kidArrayList);
applyAttendanceToKids();
adapter.notifyDataSetChanged();
listView.invalidate();
}else if(checkConnection()){
toaster("Error getting data from Server\nWorking offline!","l");
}
}
});
}
示例4: getAnimeListByUrl
import com.parse.ParseQuery; //导入依赖的package包/类
@Override
public List<Anime> getAnimeListByUrl(String url) {
ArrayList<Anime> animeList = new ArrayList<>();
ParseQuery<AnimeRecord> query = AnimeRecord.getQuery();
try {
List<AnimeRecord> animeRecords = query.whereContains("url", url).find();
for (AnimeRecord record : animeRecords) {
Anime anime = AnimeRecord.toAnime(record);
if (anime != null)
animeList.add(anime);
}
} catch (ParseException e) {
WriteLog.appendLogException(TAG, "getAnimeListByUrl(" + url + ") failed", e);
}
return animeList;
}
示例5: getAnimeListByTitle
import com.parse.ParseQuery; //导入依赖的package包/类
@Override
public List<Anime> getAnimeListByTitle(String title) {
ArrayList<Anime> animeList = new ArrayList<>();
ParseQuery<AnimeRecord> query = AnimeRecord.getQuery();
try {
List<AnimeRecord> animeRecords = query.whereContains("title", title).find();
for (AnimeRecord record : animeRecords) {
Anime anime = AnimeRecord.toAnime(record);
if (anime != null)
animeList.add(anime);
}
} catch (ParseException e) {
WriteLog.appendLogException(TAG, "getAnimeListByTitle(" + title + ") failed", e);
}
return animeList;
}
示例6: getContactInfos
import com.parse.ParseQuery; //导入依赖的package包/类
public void getContactInfos(List<String> usernames, final EMValueCallBack<List<EaseUser>> callback) {
ParseQuery<ParseObject> pQuery = ParseQuery.getQuery(CONFIG_TABLE_NAME);
pQuery.whereContainedIn(CONFIG_USERNAME, usernames);
pQuery.findInBackground(new FindCallback<ParseObject>() {
@Override
public void done(List<ParseObject> arg0, ParseException arg1) {
if (arg0 != null) {
List<EaseUser> mList = new ArrayList<EaseUser>();
for (ParseObject pObject : arg0) {
EaseUser user = new EaseUser(pObject.getString(CONFIG_USERNAME));
ParseFile parseFile = pObject.getParseFile(CONFIG_AVATAR);
if (parseFile != null) {
user.setAvatar(parseFile.getUrl());
}
user.setNick(pObject.getString(CONFIG_NICK));
EaseCommonUtils.setUserInitialLetter(user);
mList.add(user);
}
callback.onSuccess(mList);
} else {
callback.onError(arg1.getCode(), arg1.getMessage());
}
}
});
}
示例7: getEventData
import com.parse.ParseQuery; //导入依赖的package包/类
public void getEventData(final ICardCallback<ILobbyEventCard> callback) {
ParseQuery<LobbyEventCard> query = ParseQuery.getQuery(LobbyEventCard.class);
query.getInBackground(Constans.PARSE_EVENT_OBJECT_ID, new GetCallback<LobbyEventCard>() {
@Override
public void done(LobbyEventCard object, ParseException e) {
if (e == null) {
callback.onSuccess(false, object);
} else {
callback.onError(e);
}
}
});
}
示例8: retreiveprofile
import com.parse.ParseQuery; //导入依赖的package包/类
public static void retreiveprofile(String username , final Context context) {
ParseQuery<ParseObject> query= ParseQuery.getQuery("Profile");
query.whereEqualTo("user",username);
query.getFirstInBackground(new GetCallback<ParseObject>() {
@Override
public void done(ParseObject parseObject, ParseException e) {
if(parseObject!=null && e==null) {
ParseFile file = (ParseFile) parseObject.get("image");
String url = "http://wwww.webianks.com";
if (file != null) {
url = file.getUrl().toString();
}
MainActivity.retriveProfileCallback(context, url);
}else{
//canntretrivee file
}
}
});
}
示例9: retreivetimelineprofile
import com.parse.ParseQuery; //导入依赖的package包/类
public static void retreivetimelineprofile(String username , final Context context) {
ParseQuery<ParseObject> query= ParseQuery.getQuery("Profile");
query.whereEqualTo("user",username);
query.getFirstInBackground(new GetCallback<ParseObject>() {
@Override
public void done(ParseObject parseObject, ParseException e) {
if(parseObject!=null && e==null) {
ParseFile file = (ParseFile) parseObject.get("image");
String url = "http://wwww.webianks.com";
if (file != null) {
url = file.getUrl().toString();
}
Profile.retriveTimelineProfileCallback(context, url);
}else{
//canntretrivee file
}
}
});
}
示例10: categorySpinnerSetup
import com.parse.ParseQuery; //导入依赖的package包/类
public void categorySpinnerSetup() {
ParseQueryAdapter.QueryFactory<ParseObject> factory = new ParseQueryAdapter.QueryFactory<ParseObject>() {
public ParseQuery create() {
ParseQuery query = new ParseQuery("Category");
return query;
}
};
categoryAdapter = new ParseQueryAdapter<ParseObject>(this,
factory);
categoryAdapter.setTextKey("name");
categorySpinner.setAdapter(categoryAdapter);
categorySpinner.setSelection(1);
categorySpinner
.setOnItemSelectedListener(new CategorySpinnerListener());
}
示例11: loadParseData
import com.parse.ParseQuery; //导入依赖的package包/类
private void loadParseData(String Id){
ParseQuery<ParseObject> query = ParseQuery.getQuery(EventTable);
query.whereEqualTo("PhotoAlbumId", Id);
query.findInBackground(new FindCallback<ParseObject>() {
@Override
public void done(List<ParseObject> productParseList, com.parse.ParseException e) {
if (e == null) {
if(productParseList.size() > 0){
eventList.addAll(productParseList);
eventAdapter = new PhotosAdapter(mContext, eventList);
gridView.setAdapter(eventAdapter);
}else{
Toast.makeText(mContext,"Danh sách trống", Toast.LENGTH_SHORT).show();
}
} else {
e.printStackTrace();
LoggerFactory.e("loadParseData", "Error: " + e.getMessage());
}
}
});
}
示例12: loadParseData
import com.parse.ParseQuery; //导入依赖的package包/类
private void loadParseData(){
ParseQuery<ParseObject> query = ParseQuery.getQuery(tableName);
query.findInBackground(new FindCallback<ParseObject>() {
@Override
public void done(List<ParseObject> productParseList, com.parse.ParseException e) {
if (e == null) {
if(productParseList.size() > 0){
eventList.addAll(productParseList);
eventAdapter = new VideoAdapter(mContext, eventList);
gridView.setAdapter(eventAdapter);
}else{
Toast.makeText(mContext,"Danh sách trống", Toast.LENGTH_SHORT).show();
}
} else {
e.printStackTrace();
LoggerFactory.e("loadParseData", "Error: " + e.getMessage());
}
}
});
}
示例13: verifyOrganization
import com.parse.ParseQuery; //导入依赖的package包/类
private void verifyOrganization(){
final String enteredText = orgName.getText().toString().trim();
final RefreshingDialog rd = new RefreshingDialog(this);
rd.createRefreshingDialog();
ParseQuery<Organization> query = ParseQuery.getQuery(Organization.class);
query.whereEqualTo("name", enteredText);
query.findInBackground(new FindCallback<Organization>() {
@Override
public void done(List<Organization> objects, ParseException e) {
if(objects.isEmpty()){//new group
createGroupAlert(enteredText);
rd.stop();
}else{
joinGroupAlert(objects.get(0));
rd.stop();
}
}
});
}
示例14: loadData
import com.parse.ParseQuery; //导入依赖的package包/类
private void loadData() {
ParseQuery<UserInfo> query = ParseQuery.getQuery(UserInfo.class);
query.orderByDescending("score").setLimit(10);
query.findInBackground(new FindCallback<UserInfo>() {
@Override
public void done(List<UserInfo> objects, ParseException e) {
list.addAll(objects);
runOnUiThread(new Runnable() {
@Override
public void run() {
adapter.notifyDataSetChanged();
}
});
}
});
}
示例15: updateMessage
import com.parse.ParseQuery; //导入依赖的package包/类
/**
* Request a single message in a conversation to be updated.
*/
private void updateMessage(@NonNull String conversationId, @NonNull String messageId) {
ParseQuery<ParseObject> query = new ParseQuery<>(MessagesTable.NAME);
query.setCachePolicy(ParseQuery.CachePolicy.NETWORK_ONLY);
query.include(MessagesTable.Fields.IMAGE);
Log.d(TAG, "Updating message: " + messageId);
mParseHelper.get(query, messageId)
.map(in -> ParseUtils.from(in, mParseHelper))
.toList()
.subscribe(messages -> {
for (ExampleMessage message : messages) {
mUpdatePublisher.onNext(new Update<>(conversationId, Update.Action.UPDATED, null, message));
}
});
}