I know that Parse.com is a NoSql database, and SQL concepts should not be applied to it , in any case, in addition to theory, I am sure that Parse has a way to do something like a classic SQL join.
For example, suppose we have 3 tables / classes in our database: People, Cities and Countries, with examples of values ββin brackets.
People: -Name (Mario Rossi) -Age (23) -City (Bologna) Cities: -Name (Bologna) -PostalCode (40100) -Country (Italy) Countries: -Name (Italy) -Continent (Europe)
Given this structure, let's say I want to know on what continent the man Mario Rossi, 23 years old, lives. In the classic SQL approach, this would be easy to do:
select People.Name,People.Age,Countries.Continent from People JOIN Cities on People.City = Cities.name JOIN Countries on City.Country = Countries.Name Where People.Name = 'Mario Rossi'
As a result, the record set will be "Mario Rossi, 23, Europe." Now, if I want to do the same with Parse, or better, if I want to get the same result with Parse, what should my structure look like? Should I use pointers? Recommendations? I read about these structures, but I do not know if they are applicable to this business and how to use them. I am developing in Android, but since this is the main question, I think I can accept / understand the answers on other platforms.
Thanks!
Edit after Fosco's suggestions:
public class CustomAdapter extends ParseQueryAdapter <ParseObject> implements OnItemClickListener{ public CustomAdapter(Context context) { super(context, new ParseQueryAdapter.QueryFactory<ParseObject>() { public ParseQuery<ParseObject> create() { ParseQuery<ParseObject> query = ParseQuery.getQuery("People"); query.include("City"); query.include("City.Country"); query.whereEqualTo("Name","Mario Rossi"); return query; } }); } @Override public View getItemView(ParseObject parseobject, View v, ViewGroup parent) { if (v==null){ v = View.inflate(getContext(), R.layout.row_ppl, null); } super.getItemView(parseobject, v, parent); ParseObject city = parseobject.getParseObject("City"); ParseObject country = City.getParseObject("Country"); String continent = country.getString("Continent"); TextView nome = (TextView) v.findViewById(R.id.textView1); nome.setText(parseobject.getString("Name")); TextView cont = (TextView) v.findViewById(R.id.textView2); cont.setText(continent); return v; } @Override public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) { Log.d("rilevato ", "click"); } }