0

I am trying to run a query using com.parse:parse-android:1.13.0 version of the parse android SDK. I am creating a query on the local storage and using ParseQuery$whereMatchesQuery() method to match a column storing pointer to another class in my database. The code that I have is the following:

ParseQuery<PracticeSessionDetails> query = ParseQuery.getQuery(PracticeSessionDetails.class);
query.fromLocalDatastore();
query.ignoreACLs();
query.whereEqualTo("user", ParseUser.getCurrentUser());

ParseQuery courseQuery = new ParseQuery("Course");
courseQuery.whereEqualTo("objectId",courseId);
query.whereMatchesQuery("course", courseQuery);

When I run the query using query.getFirst(), I do not get anything retrieved from the local storage. I have already checked running the courseQuery separately and it fetches me Course object that I need. Is this a known issue? I proceeded with this way by getting help from this post.

Swapnil
  • 1,870
  • 2
  • 23
  • 48

1 Answers1

1

I think you are mixing query while storing pointer to another class in your database. Use following code to resolve your problem:

   ParseQuery<PracticeSessionDetails> query = ParseQuery.getQuery(PracticeSessionDetails.class);
   query.fromLocalDatastore();
   query.ignoreACLs();
   query.whereEqualTo("user", ParseUser.getCurrentUser());

   ParseQuery<ParseObject> courseQuery = ParseQuery.getQuery("Course");
   courseQuery.whereMatchesQuery("course", query);
Yash786
  • 21
  • 2