Java 如何使用关系数据解析WherewhithInMiles函数?

Java 如何使用关系数据解析WherewhithInMiles函数?,java,android,parse-platform,relational-database,Java,Android,Parse Platform,Relational Database,我有一个Field类,它有一个指向父类的指针,父类是Venue,Venue有一个Location列,我想做一个查询,只带30英里以内的字段 query.whereWithinMiles("venueId.Location", userLocation, 30); 我确信错误在venueId.Location中,但我不知道如何获取指针的Location列的值 venueId是指针。 Location是我要比较的指针的列。 userLocation是用户当前的位置 感谢阅读。where查询中不支持

我有一个Field类,它有一个指向父类的指针,父类是Venue,Venue有一个Location列,我想做一个查询,只带30英里以内的字段

query.whereWithinMiles("venueId.Location", userLocation, 30);
我确信错误在venueId.Location中,但我不知道如何获取指针的Location列的值

venueId是指针。 Location是我要比较的指针的列。 userLocation是用户当前的位置


感谢阅读。

where查询中不支持点表示法,而仅在include中支持点表示法。 如果您想这样做,您需要使用**whereMatchesKeyInQuery编写查询**

因此,在您的情况下,它应该是这样的(根据您的类更改值):


where查询中不支持点表示法,但仅在include中支持点表示法。 如果您想这样做,您需要使用**whereMatchesKeyInQuery编写查询**

因此,在您的情况下,它应该是这样的(根据您的类更改值):

ParseQuery query = new ParseQuery.getQuery("ParentClass");  // change the class name
ParseGeoPoint point = new ParseGeoPoint(40.712784,-74.005941);  // put your location here
query.whereWithinMiles("location",point,30);

ParseQuery venueQuery = new ParseQuery.getQuery("SubClass");  // change the class name
venueQuery.whereMatchesKeyInQuery("venueId","objectId",query);
venueQuery.findInBackground(new FindCallback() {
    @Override
    public void done(List objects, ParseException e) {

    }

    @Override
    public void done(Object o, Throwable throwable) {

    }
});