Android:使用ParseUser对象查找对象

时间:2015-05-03 00:18:26

标签: android parse-platform

我有一个名为注意的ParseObject子类,它有一个列$ javac Tiles.java $ java MainApp map: '[[2, 0, 0, 0, 0, 0, 0, 0, 0, 2], [2, 0, 0, 0, 0, 0, 0, 0, 0, 2], [2, 0, 0, 0, 0, 0, 0, 0, 0, 2], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]]'. intItems: '[2, 0, 0, 0, 0, 0, 0, 0, 0, 2]'. intItems: '[2, 0, 0, 0, 0, 0, 0, 0, 0, 2]'. intItems: '[2, 0, 0, 0, 0, 0, 0, 0, 0, 2]'. intItems: '[1, 1, 1, 1, 1, 1, 1, 1, 1, 1]'. ,它是指向owner类(ParseUser)的指针。我的对象类上还有一个User列,当时只使用它作为"规则"它工作正常。

添加ownerSignedOut"规则"没有给我任何结果。

注意包含以下列:

  • objectId(String)
  • 所有者(指针< _User>)
  • ownerSignedOut(Pointer< _Installation>)
  • title(String)
  • createdAt(Date)
  • updatedAt(日期)
  • ACL(ACL)

尝试仅获取属于特定ownerowner

的对象
ownerSignedOut
  • 仅使用 query1 不会给我带来任何结果
  • 仅使用 query2 为我提供了正确的结果
  • 使用 query1& query2 没有给我任何结果

修改 在这里你可以看到指针工作正常 A picture showing the objects and their pointers

编辑2: 这就是我创建对象的方式:

List<ParseQuery<Note>> queries = new ArrayList<ParseQuery<Note>>();

ParseQuery<Note> query1 = ParseQuery.getQuery( Note.class );
query1.whereEqualTo( "owner", ParseUser.getCurrentUser() );
queries.add( query1 );

ParseQuery<Note> query2 = ParseQuery.getQuery( Note.class );
query2.whereEqualTo( "ownerSignedOut", ParseInstallation.getCurrentInstallation() );
queries.add( query2 );

ParseQuery<Note> query = ParseQuery.or( queries );
query.addDescendingOrder( "updatedAt" );
query.findInBackground( new FindCallback<Note>() {
    // other code

修改 我的Installation类有if ( ParseUser.getCurrentUser() != null && ParseUser.getCurrentUser().getUsername() != null ) { noteItem.put( "owner", ParseUser.getCurrentUser() ); } noteItem.put( "title", title ); noteItem.put( "ownerSignedOut", ParseInstallation.getCurrentInstallation() ); noteItem.saveInBackground( new SaveCallback() { @Override public void done( ParseException e ) { setResult( 1 ); finish(); } } ); 列,它是指向User类的指针。那可能是冲突吗?

0 个答案:

没有答案