• 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: removeObjectFromBothSidesOfRelationshipWithKey() question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: removeObjectFromBothSidesOfRelationshipWithKey() question


  • Subject: Re: removeObjectFromBothSidesOfRelationshipWithKey() question
  • From: "Ricardo J. Parada" <email@hidden>
  • Date: Tue, 27 Oct 2009 19:20:16 -0400

Resending with some typos fixed... :-)

Hi,

Let's say you have to-many relationship between two entities:  Order <-->> OrderItem.  The to-many relationship is called "items" and "Owns Desintation" is checked.

Test #1:  Create an Order and OrderItem and insert both into an editing context.  Then add the item to the order using order.addObjectToBothSidesOfRelationshipWithKey(item, "items").  Then removeObjectFromBothSidesOfRelationshipWithKey(item, "items") to remove the item.  Then save the editing context.

Result:   EOF attempts to save both the order and the orphan item.
Expected Result:  I thought EOF would only attempt to save the order but not the item removed from the "items" to-many.

Test #2: Fetch an existing order with one item from the database.  Then order.removeObjectFromBothSidesOfRelationshipWithKey(item, "items").  Save the editing context.  

Result:  EOF deletes the item that was removed from the "items" to-many.

Is this how it's supposed to work?

Thanks,
Ricardo

 _______________________________________________
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

  • Follow-Ups:
    • Re: removeObjectFromBothSidesOfRelationshipWithKey() question
      • From: Lon Varscsak <email@hidden>
  • Prev by Date: removeObjectFromBothSidesOfRelationshipWithKey() question
  • Next by Date: Deleting All Objects in a Database
  • Previous by thread: removeObjectFromBothSidesOfRelationshipWithKey() question
  • Next by thread: Re: removeObjectFromBothSidesOfRelationshipWithKey() question
  • Index(es):
    • Date
    • Thread