Since ingredients only belong to a recipe list, I assume that recipies have a reference to the ingredients that belong to their list.
If your reference are pointers to all the ingredients of a recipe then this should suffice
ParseQuery<ParseObject> query = ParseQuery.getQuery("Recipies");
query.include("ingredients"); //Name of your ingredients table
query.findInBackground(new FindCallback<ParseObject>() {
@Override
public void done(List<ParseObject> objects, ParseException e) {
if (e == null) {
for(int index = 0; index < objects.size(); i++){
objects.get(i); //This is a recipe
objects.get(i).get("name of the column that hold the pointer"); //This is your ingredient
}
} else {
Log.e("", e.getMessage());
}
functionCallback.done(objects, e);
}
});
More information about 'include' query can be found here (under Relational Queries)
If you store the reference in an array you could try and do something like this
ParseQuery<ParseObject> ingredientQuery = ParseQuery.getQuery("ingredients");
ParseQuery<ParseObject> query = ParseQuery.getQuery("Recipies");
query.findInBackground(new FindCallback<ParseObject>() {
@Override
public void done(List<ParseObject> objects, ParseException e) {
if (e == null) {
for(int index = 0; index < objects.size(); i++){
objects.get(i); //This is a recipe
String[] pointers = objects.get(i).get("name of the column that hold the pointer");
//This is your ingredient reference (if you did 'recipe.put("ingredients", ingredient);',
//the reference that would be saved is the id of the ingredient.
ingredientsQuery.whereContainedIn("objectId", pointers);
ingredientsQuery.findInBackground(new FindCallback<ParseObject>() {
@Override
public void done(List<ParseObject> ingredients, ParseException e) {
if (e == null) {
for(int index = 0; index < ingredients.size(); i++){
ingredients.get(i); //This is a ingredient
}
} else {
Log.e("", e.getMessage());
}
}
} else {
Log.e("", e.getMessage());
}
functionCallback.done(objects, e);
}
});
Think this should about do it!