- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我正在尝试使用 Parse 查询获取对象。
这是我的代码:
ParseQuery<ParseObject> query = ParseQuery.getQuery("Conference");
query.findInBackground(new FindCallback<ParseObject>() {
public void done(List<ParseObject> results, ParseException e) {
if (e == null) {
// Results were successfully found from the local datastore.
} else {
showLog(e.toString());
}
}
});
我收到这个错误:
com.parse.ParseException: java.lang.IllegalStateException: ParseObject has no data for 'objectId'. Call fetchIfNeeded() to get the data.
顺便说一句,我的 Conference
类包含指针。
最佳答案
如果您直接从 Parse 查询,您可以:
ParseQuery<ParseObject> query = ParseQuery.getQuery("Conference");
...
query.include("name_of_the_column_containing_a_pointer");
query.include("another_pointer_column");
query.findInBackground(new FindCallback<ParseObject>() {
public void done(List<ParseObject> results, ParseException e) {
if (e == null) {
// You can now access the pointers specified in the include
} else {
showLog(e.toString());
}
}
});
否则,如果您正在查询本地数据存储:
ParseQuery<ParseObject> query = ParseQuery.getQuery("Conference");
...
query.findInBackground(new FindCallback<ParseObject>() {
public void done(List<ParseObject> results, ParseException e) {
if (e == null) {
ParseObject parseObject = results.get(0); // Get the object
parseObject.fetchIfNeededInBackground(new GetCallback<ParseObject>() {
public void done(ParseObject result, ParseException e) {
if (e == null)
// Do something with result
}
}
} else {
showLog(e.toString());
}
}
});
关于java - 查询 ParseObject,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33802581/
当我尝试登录时出现错误并且应用程序正在关闭。 java.lang.IllegalArgumentException:您必须使用 ParseObject.create() 或适当的子类创建这种类型的 P
我正在尝试使用以下代码将 ParseObjects 的数组列表从一个 Activity 发送到另一个 Activity : Intent intent = new Intent(MainActivit
我有超过 153 个对象存储在名为“HSK1”的解析服务器类中。我想显示 ListView 中的所有对象,但下面的代码只显示 100 个元素。这是为什么? 我检查了数组的大小,它只存储 100 个对象
我使用这段代码实际上让用户发送一个问题和 4 个答案(这是一个很长的故事),并将其存储在我的游戏数据库中。这是我在查看文档后使用的代码,只是表格没有更新。我真的不知道为什么 private void
我正在使用 Parse Android SDK,并且我有一个 objectId 作为 String,我想将其转换为 ParseObject 什么是在 Kotlin 或 Java 中最好的方法是什么?
我遇到了一个奇怪的错误。我无法删除我的 Favourite扩展 ParseObject 的对象. 当我尝试执行这段代码时发生错误: ParseQuery query = getCurrentUserF
我有一个带有构造函数的 ParseObject 子类,它试图用新的 UUID 设置一个字段: @ParseClassName("Results") public class Results exten
我希望将一个 Calendar 对象添加到我创建的 ParseObject 中,但每当我尝试添加它时它都会抛出异常: ParseObject route = new ParseObject(Parse
我在我的项目中使用 Parse.com。我想创建自己的实体类扩展 Parse 对象,但我有一个 java.lang.ClassCastException: com.parse.ParseObject
我正在尝试使用 Parse 查询获取对象。 这是我的代码: ParseQuery query = ParseQuery.getQuery("Conference"); query.findIn
我正在按照快速入门指南进行操作,但出现错误 private void parseServerTest(){ ParseObject testObject = new ParseObject("T
到目前为止,我只是使用 Parse SDK 直接查询对象,然后检索其属性,即 postObject.getString("bodyText")、postObject.getList("喜欢的人”),等
我正在尝试从已发送到另一个方法的 ParseObject relationShipObject 中获取值 relatedGuild。 我的代码: private void getRelation(){
我在查询中引用“用户”对象时遇到问题。我有以下代码: Parse.Cloud.define("getTabsBadges", function(request, response) { var U
我在使用 Parse 的 Android 应用程序中遇到以下错误: 您必须在实例化之前注册此 ParseObject 子类。 在我的 Application 对象中,我在 onCreate 中执行以下
我需要一种方法来根据用户的选择查询不同的解析类。我按如下方式解决了这个问题。请告知如何解决我遇到的问题或建议替代/更好的方法。 我有课A, B, C, ...对应于 Parse 类。它们非常相似。所以
也许这是一个愚蠢的问题,但我只是想打印 ParseObject(Parse 平台)的所有内容(不仅仅是一个字段)。但我没有找到任何相关信息,无论是 API、论坛还是这里。 toString 方法在 A
我正在使用此代码从我的 ParseObject 中获取姓名和年龄字符串在解析中。我假设我也可以对图像文件做同样的事情。但是此代码不适用于图像。我可能做错了。或者也许我需要做一些完全不同的事情。有人可以
这不是 android 问题,而是更多 Parse.com 问题,但我需要你的帮助: 我在 Parse.com 的应用程序的表格中有一个图像文件 文件没问题,我可以手动下载看 但是当我尝试使用我已经从
如何获得指向解析对象的指针? 例如,我的 ParseUser 有一个名为“school”的列,它是一个指向 Parse 类“School”的指针 school Pointer 我能够获得一个 Scho
我是一名优秀的程序员,十分优秀!