WHERE clauses in Data Service queries in Android

At this link:

down the page an example of using the “Where” clause in a BackendlessDataQuery:
Find all contacts in a city for a specific phone book

The example is a simple phone book where the search is for “Contacts”. The “Contact” class does not seem to include a member “PhoneBook[contacts]” that is referenced in the “Where” clause being built. Indeed, “Contact” is a child record of the “contacts” list member and the “owner” member of the “PhoneBook” record.

Two questions arise:

  1. Can one indeed specify parent records in a “where” clause as may be happening here? E.g. presumably “PhoneBook.contacts” (PhoneBook[contacts]?) is a list member that can include the ID of a one or more “Contact” records, and “PhoneBook.owner” is a scalar member that can be the ID of a “Contact” record.

  2. If we suppose the only “Contact” member of the “PhoneBook” record is “PhoneBook.owner”, how can one specify that one wants only the “Contact” records that are NOT owners of a “PhoneBook” record? For a test example with some other records analogous to this, it appears the equivalent of neither of these work:
    whereClause.append(“PhoneBook.owner IS null”)
    whereClause.append(“PhoneBook IS null”)

Is it possible to accomplish this with a single query? If so, can someone tell us how?


Hi Kevin,

Have you solved your problem yet?