2016-07-29 3 views
0

저는 Venue에 "Father"클래스에 대한 포인터가있는 Field 클래스가 있습니다. Venue에는 Location 열이 있는데, 나는 30 마일 이내에있는 Field만을 가져 오는 쿼리를 만들고 싶습니다.구문 분석에서 관계형 데이터를 사용하는 방법 WhereWithinMiles는 작동합니까?

query.whereWithinMiles("venueId.Location", userLocation, 30); 

나는 실수가 venueId.Location에 있는지 확인 해요,하지만 난 내 포인터의 위치 열의 값을 얻을하는 방법을 모르겠어요.

venueId는 포인터입니다. 위치는 비교하고 싶은 포인터의 열입니다. userLocation은 사용자의 현재 위치입니다.

읽어 주셔서 감사합니다.

답변

2

도트 표기법은 어디에있는 쿼리에서 지원되지만 포함에서만 사용됩니다. 당신이 그것을 좋아한다면 당신은 당신의 쿼리를 작성해야합니다 ** 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) { 

    } 
}); 
관련 문제