From that thread Frans says:
Isn't that a bit weird? I mean: the adapter classes are considered disconnected from whatever persistence store, so if there is no data in the collection, either you didn't fetch it or it wasn't there. Which one it is, depends on your own code. If you request the data for some entity and some related collections, the data is thus fetched and apparently there was no data.
the thing is that you should simply think in these steps:
- I want to process something
- I need data
- I get the data
- I got the data and will now process it.
- I'm finished processing
- Next!
You're either in this cycle or outside this cycle.
Now, I can understand that. But, from a practical standpoint it's not that straightforward. For example, today I create an Adapter.Fetch call that retreives an entity with a few related collections. I don't prefetch all related collections because I don't need all of them for this particular call and I want to keep the graph as small as possible.
Next week, I need this entity again. I use the previously created call but this time I need to access another related collection - not prefetched in the call because I didn't need the collection before.
It's a good idea to always check the fetch call before using it in a new coding situation. I don't always do it. That's why I thought that an IsFetched flag would help prevent unexpected problems.
Jeff