我的app上有帖子和评论类和活动。我正在尝试查询具有指针parent<postId>
的评论对象到帖子对象。
指针是post对象的objectid。在comment活动中,当用户单击post按钮时,将创建关系。
Comments comments = new Comments();
comments.put("parent",ParseObject.createWithoutData("post",postId));
当我尝试查询评论对象时,如
ParseQueryAdapter.QueryFactory<Comments>factory= new ParseObjectAdapter.QueryFactory<Comments>(){
ParseQuery<Comments>query =Comments.getquery();
query.whereEqualTo("parent",postId);
query.include ("user");
query.findInBackground(new FindCallback<Comments>(){
@Override
public void done(List<Comments>list,ParseException e){
if (e!=null){if(Application.APPDEBUG){
Log.d(Application.APPTAG,"Error ",e);
}
return;
}});
query.orderByDescending("createdAt");
return query;
}};
我得到java.lang.NullPointerException
。如何查询相关的解析对象?