Re: Standalone prefetch without main query?

John Pollard <[email protected]>
Newsgroups gmane.comp.web.webobjects.eof
Message-ID <[email protected]>
>>  When prefetching as part of a fetch spec some clever code bases the 
>> query for Continents (in your example) on the criteria of the main query 
>> for People, not requiring an OR for each Company returned. I wish 
>> batchFetchRelationship() could be that clever.
>
>Yes.  You can figure out how to write an appropriate fetch spec that will 
>fetch the objects based on the joins, rather than a bunch of ORs.  The 
>problem is getting the to-many relationship faults to be filled with these 
>results, rather than remain faults that will go to the db upon fetch.

I was just making the point that prefetching on a normal fetch spec does 
exactly that i.e. filling the to-many relationship faults for any keypath 
from the base object that is being queried preventing them firing when they 
are accessed later. This is invaluable to me and I use it a lot to save on 
oodles of processing. I am just being greedy in that I would like to see 
batchFetchRelationship() also accept keypaths rather than just a 
relationship and to base the query for deeper relationships in the keypath 
on the top level query as it is for fetch specs.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.