Re: AddObjectToBothSidesOfRelationshipWithkey
Re: AddObjectToBothSidesOfRelationshipWithkey
- Subject: Re: AddObjectToBothSidesOfRelationshipWithkey
- From: Alexander Spohr <email@hidden>
- Date: Thu, 19 Apr 2007 19:47:07 +0200
Frank,
go to your EOModel and switch off the diamond on the relationship
from A to B, then
go to your EOModel and switch off the diamond on the relationship
from C to B, then
try again.
The fetches should be gone.
Your only problem now: you need to do a fetch to get all Bs belinging
to an A or C.
Am 19.04.2007 um 16:42 schrieb Frank Stock:
Ken,
I have a many to many relation.
A<->>B<<->C
Primary keys are A.pk,B.pk,C.pk
The select statements are (after the 2
addObjectToBothSidesOfRelationshipWithKey)
select t0..... from B where A.pk= xxxx;
select t0.... from B where C.pk = xxxx;
This doesn't make sense to me why these select statements are
performed.
Then think again about what addObjectToBothSidesOfRelationshipWithKey
is made for.
It tells EOF to add B to the Relationship coming from A pointing to
B. That is an NSArray, so it has to have all the objects of B that
your A points to. So EOF goes to the database and get all Bs pointed
to by A.
And then EOF drops your B into that Relationship-Array of A.
Am 19.04.2007 um 15:57 schrieb Frank Stock:
what I don't understand is why all the relation-rows are fetched,
not just the selection thats needed?
This is a wrong assumption. EOF needs these objects to fill the
relationships Array. So it fetches what it needs.
atze
_______________________________________________
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