• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: AddObjectToBothSidesOfRelationshipWithkey
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Re: AddObjectToBothSidesOfRelationshipWithkey (From: "Shravan Kumar.M" <email@hidden>)
 >Re: AddObjectToBothSidesOfRelationshipWithkey (From: Frank Stock <email@hidden>)
 >Re: AddObjectToBothSidesOfRelationshipWithkey (From: Ken Anderson <email@hidden>)
 >Re: AddObjectToBothSidesOfRelationshipWithkey (From: Frank Stock <email@hidden>)
 >Re: AddObjectToBothSidesOfRelationshipWithkey (From: Ken Anderson <email@hidden>)
 >Re: AddObjectToBothSidesOfRelationshipWithkey (From: Frank Stock <email@hidden>)

  • Prev by Date: Re: Converting from Session to DA
  • Next by Date: Re: Converting from Session to DA
  • Previous by thread: Re: AddObjectToBothSidesOfRelationshipWithkey
  • Next by thread: Re: AddObjectToBothSidesOfRelationshipWithkey
  • Index(es):
    • Date
    • Thread