Hello John,

This isn't a problem, but you can't use the flattened many-to-many relationship. Delete that from your model. Create the AccountStore object manually, and associate it with the Account and Store objects with 2 addObjectToBothSidesOfRelationshipWithKey statements. Set your value in AccountStore. Everything will be saved at the same time.

The flattened many-to-many is cool, but if you have a value in the intermediate table, then it's an object in its own right.

Regards,
Mark


On Feb 3, 2006, at 12:10 PM, John Huss wrote:

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 protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/markm% 40onpointsoftware.com

This email sent to [EMAIL PROTECTED]

_______________________________________________
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