Modifying intermediate table in Many-To-Many relationship
Modifying intermediate table in Many-To-Many relationship
- Subject: Modifying intermediate table in Many-To-Many relationship
- From: "John Huss" <email@hidden>
- Date: Fri, 3 Feb 2006 12:10:15 -0600
I have a many-to-many relationship like this:
Account -> AccountStore -> Store
When I add a store to an account with
addObjectToBothSidesOfRelationshipWithKey (via the magic of many-to-many
relationships) the object representing the intermediate table does not get
created in memory. It only is accessible after everything has been saved
and refetched.
So when I examine it, account.accountStores() is empty.
I need to set a value in this intermediate table, preferably at the same
time everything else is saved.
I can set up all the relationships manually to make sure everything is
correct in memory, but then when I go to save, it tries to create TWO rows
in the intermediate table causing a primary key violation.
Any ideas about the best way to do this?
John
_______________________________________________
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