title: Android Parse.com query relation
body: <p>I have a custom Employee table and custom Organization table.
  Employee table has a column Relation&lt; Organization >.
  I want to query organizations of an employee object.</p>
  
  <pre><code>// I have an employee object
  ParseObject employee = ParseUser.getCurrentUser().getParseObject("employee");
  // I get relation query
  ParseQuery&lt;ParseObject&gt; query = employee.getRelation("organizations").getQuery();
  // I execute query like this
  query.findInBackground(new FindCallback&lt;ParseObject&gt;() {
          @Override
          public void done(List&lt;ParseObject&gt; list, ParseException e) {
              // code here
          });
  </code></pre>
  
  <p>In my callback I'm getting ClassCastException:</p>
  
  <pre><code>Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to org.json.JSONObject
          at com.parse.ParseRESTQueryCommand.constructParameters(ParseRESTQueryCommand.java:84)
          at com.parse.ParseRESTQueryCommand.findCommand(ParseRESTQueryCommand.java:15)
          at com.parse.ParseDefaultQueryController.findFromNetworkAsync(ParseDefaultQueryController.java:57)
          at com.parse.ParseDefaultQueryController.access$100(ParseDefaultQueryController.java:17)
          at com.parse.ParseDefaultQueryController$6.runOnNetworkAsync(ParseDefaultQueryController.java:193)
          at com.parse.ParseDefaultQueryController.runCommandWithPolicyAsync(ParseDefaultQueryController.java:292)
          at com.parse.ParseDefaultQueryController.findWithCachePolicyAsync(ParseDefaultQueryController.java:201)
          at com.parse.ParseDefaultQueryController.findAsync(ParseDefaultQueryController.java:28)
          at com.parse.ParseQuery.findAsync(ParseQuery.java:1187)
          at com.parse.ParseQuery$2$1.then(ParseQuery.java:1129)
          at com.parse.ParseQuery$2$1.then(ParseQuery.java:1125)
          at bolts.Task$14.run(Task.java:796)
          at bolts.BoltsExecutors$ImmediateExecutor.execute(BoltsExecutors.java:105)
          at bolts.Task.completeAfterTask(Task.java:787)
          at bolts.Task.continueWithTask(Task.java:599)
          at bolts.Task.continueWithTask(Task.java:610)
          at bolts.Task$12.then(Task.java:702)
          at bolts.Task$12.then(Task.java:690)
          at bolts.Task$14.run(Task.java:796)
          at bolts.BoltsExecutors$ImmediateExecutor.execute(BoltsExecutors.java:105)
          at bolts.Task.completeAfterTask(Task.java:787)
          at bolts.Task.continueWithTask(Task.java:599)
          at bolts.Task.continueWithTask(Task.java:574)
          at bolts.Task.onSuccessTask(Task.java:690)
          at bolts.Task.onSuccessTask(Task.java:680)
          at bolts.Task.onSuccessTask(Task.java:714)
          at com.parse.ParseQuery$2.call(ParseQuery.java:1125)
          at com.parse.ParseQuery$2.call(ParseQuery.java:1122)
          at com.parse.ParseQuery.doWithRunningCheck(ParseQuery.java:1091)
          at com.parse.ParseQuery.findInBackground(ParseQuery.java:1122)
  </code></pre>
  
  <p>What am I doing wrong? This is done exactly like in Parse tutorial (<a href="https://www.parse.com/docs/android/guide#relations-using-parse-relations" rel="nofollow">https://www.parse.com/docs/android/guide#relations-using-parse-relations</a>). I didn't find any answer to this on Google or SOF.
  Any help will be appreciated.</p>