Weird problem with setPrefetchingRelationshipKeyPaths
Weird problem with setPrefetchingRelationshipKeyPaths
- Subject: Weird problem with setPrefetchingRelationshipKeyPaths
- From: Miguel Arroz <email@hidden>
- Date: Sun, 16 Mar 2008 18:32:32 +0000
Hi!
I have an entity A where each object contains some references to
other objects in entity B (each A contains some Bs, but each B is on a
diferente relation). The relations are one-to-one, and are modeled
only from A to B.
I'm fetching some objects from entity A, and I'm using
setPrefetchingRelationshipKeyPaths to pre-fetch the Bs. I'm passing in
an array with all the relationship keys I want to grab.
I run this, and it looks like it's going to work. The A SELECT
query is done, and then some SELECT DISTINCT queries are done on the B
table, fetching the related B objects. I copied one of those querie
from the log to the DB console and run it, and it does in fact select
the objects that it's supposed to.
So far, looks good. The problem is that when I later iterate among
the fetched A objects and start to access Bs, the Bs are all fetched
again, each one in it's roundtrip.
I fired up the debugger, and something really strange happens.
After all those queries being done, I peek inside an A object, and
find that Bs are not being placed in As. IE, all the relationship to
Bs are still faults, not real data.
So, EOF is fetching the objects, but it's not inserting them on the
graph... why?
Yours
Miguel Arroz
Miguel Arroz
http://www.terminalapp.net
http://www.ipragma.com
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden