我想知道是否可以通过属性类的属性来筛选对象。
更具体地说,如果我有:
Person<br>
-BasicInformation basicInformation
BasicInformation<br>
-Integer identificationNumber我想检索所有拥有identificationNumber = 9000000的人
我应该这样做:
ParseQuery<Person> personQuery = ParseQuery.getQuery(Person.class);
personQuery.whereEqualTo("basicInformation.identificationNumber", 9000000);但不起作用。有什么想法吗?
发布于 2015-08-28 01:52:37
谢谢各位。我已经解决了。
我必须做下面的步骤。
ParseQuery basicInformationQuery = ParseQuery.getQuery(BasicInformation.class);
basicInformationQuery.whereEqualTo("identificationNumber",9000000);
然后
ParseQuery personQuery = ParseQuery.getQuery(Person.class);
( personQuery.whereMatchesQuery("basicInformation",basicInformationQuery);
personQuery.find();
发布于 2015-08-27 15:11:50
您应该能够使用关系查询。然后,主查询将查询与子查询结果匹配的所有Person对象。
我很快地检查了Parse4J的文档,它似乎不支持这一点,所以您可能需要自己实现或者直接调用REST-API。
https://stackoverflow.com/questions/32173510
复制相似问题