2

I wanna say if there's a solution to make only one request to receive data from different tables.

For example:

I have table "books", "pencils" and another. I wanna receive only the last row of these tables.

With ParseObject i can do a List of ParseObjects and use function findAllInBackground. But this function there isn't in PareqQuery Object.

There is a solution? If I use CloudCode I can make this easy, with less request?

Thanks,Giovanni.

UPDATE: 15 September 2014 My answer is: How I can make different querys ex: "SELECT * FROM BOOK" and "SELECT * FROM PENCILS" with only one request.

My code now is this. but this can take the query from only one table:

ParseQuery query = ParseQuery.getQuery("books");
    query.orderByDescending("id");
    query.setLimit(1);

    query.findInBackground(new FindCallback<ParseObject>() {

        @Override
        public void done(List<ParseObject> parseObjects, com.parse.ParseException e) {
            if(e == null) {
                try {
                    String IDBOOK;
                    try {
                        IDBOOK = parseObjects.get(0).getString("id");
                    } catch (Exception e1) {
                        IDBOOK = "0";
                    }
                } catch (NoSuchMethodException e1) {
                    e1.printStackTrace();
                } catch (InvocationTargetException e1) {
                    e1.printStackTrace();
                } catch (IllegalAccessException e1) {
                    e1.printStackTrace();
                }
            } else {
                Log.i(TAG, "Error on data received");
            }
        }
    });
Giovanni Genna
  • 247
  • 1
  • 3
  • 7

1 Answers1

0

You can use query.whereEqualTo Since you are using Parse Object for your Query.

Best Regards

hatboy
  • 66
  • 1
  • 8