On May 11, 2006, at 5:01 PM, Owen McKerrow wrote:

Hi All,

Say I have the following set-up

Person <- ->> PersonName
PersonName <- ->> Publications

And I set the Batch Faulting Batch Size to 10 between Person and PersonName and set it to 10 between PersonName and Publications will they both "fire" off when I grab a person ?

No.  Neither will fire until you touch (reference) them.


i.e. I search for a user, who has 3 names, each of which has 3 publications associated with it. Will I get back 13 rows ? 1 for the person, 3 for the names and 9 for the pubs ? Or more precisely will it grab all of those in 1 SQL statement ? Or would I get ( and I think this is more probable ) 4 objects, 1 for the person and 3 for their names ?

I think you are confusing prefetchingRelationshipKeyPaths in a fetch specification and batch faulting. Batch faulting just ensure that when one fault is fired, others are fired at the same time so that fewer trips are made to the database. prefetchingRelationshipKeyPaths is about pulling in all objects related to the object(s) being fetched. If you fetch the person and set prefetchingRelationshipKeyPaths to ("personNames", "personNames.publications") EOF will make three selects. One for Person, one for all PersonNames for that Person, and one for the Publications. The fetch will return the single person object.


Chuck

--
Coming in 2006 - an introduction to web applications using WebObjects and Xcode http://www.global-village.net/wointro

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems. http://www.global-village.net/products/practical_webobjects




_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to