• 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: Problem with locking and deleting with many-to-many relationship
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Subject: Re: Problem with locking and deleting with many-to-many relationship
  • From: Art Isbell <email@hidden>
  • Date: Wed, 26 Nov 2003 12:31:37 -1000

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>)

  • Prev by Date: Re: WebObjects 5.2.2, Cocoa EOF applications, Postgresql Plugin problems
  • Next by Date: Re: Problem with locking and deleting with many-to-many relationship
  • Previous by thread: Re: Problem with locking and deleting with many-to-many relationship
  • Next by thread: WAR's and XCode Missing Errors
  • Index(es):
    • Date
    • Thread