On Tue, Oct 27, 2009 at 4:20 PM, Ricardo J. Parada <
email@hidden> wrote:
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
_______________________________________________
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
--
Chuck Hill Senior Consultant / VP Development
Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects