Hi Frans,
I've noticed the queries performed when using the prefetch option in Adapter, and I had some questions.
I'll describe my case: 3 tables - Country, City, School - where each country has more than one city (each city belongs to one country) and each city has more than one school (each school belongs to one city). I am fetching the CountryEntity object and below the queries performed:
1. SELECT COUNTRY.ID, COUNTRY.NAME
FROM COUNTRY
2. SELECT CITY.ID, CITY.NAME, CITY.COUNTRY_ID
FROM CITY
WHERE (CITY.COUNTRY_ID IN (SELECT COUNTRY.ID FROM COUNTRY))
3. SELECT SCHOOL.ID, SCHOOL.NAME, SCHOOL.CITY_ID
FROM SCHOOL
WHERE (SCHOOL.CITY_ID IN
(SELECT CITY.ID FROM CITY WHERE (CITY.COUNTRY_ID IN
(SELECT COUNTRY.ID FROM COUNTRY))))
Now, it's good to know that the number of the queries is the minimum required, but my problem is with the the sub-queries. For example, I find the where caluse in query no. 2 unnecessary, since CITY.COUNTRY_ID is a FK referencing COUNTRY.ID....and same thing for query no. 3.....