Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem with locking and deleting with many-to-many relationship



On Nov 26, 2003, at 10:50 AM, Gerald Hanks wrote:

I have a flattened many-to-many relationship from item to option which uses
three tables: item, option, and item_option. The item object has a flattened
attribute called options.

If you didn't ask EOModeler to build this many-to-many relationship, you might try doing so because building one manually is difficult to do correctly.


When I add an option to the options list using

anItem.addToOptions(anOption) I get the following SQL on saveChanges()

When I remove an option from the options list using

anItem.removeFromOptions(anOption) then I get the following SQL on saveChanges()

Generally, atItem.addObjectToBothSidesOfRelationshipWithKey("options") and anItem.removeObjectFromBothSidesOfRelationshipWithKey("options") should be used. These invoke addToOptions() and removeFromOptions(), respectively, but they also correctly manage the inverse relationship, Option.items.


Aloha,
Art
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Problem with locking and deleting with many-to-many relationship (From: Gerald Hanks <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.