• 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: Owns Destination problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Owns Destination problem


  • Subject: Re: Owns Destination problem
  • From: David Avendasora <email@hidden>
  • Date: Wed, 20 Aug 2008 06:50:42 -0400


On Aug 19, 2008, at 10:31 PM, Lachlan Deck wrote:

On 20/08/2008, at 8:24 AM, Chuck Hill wrote:


On Aug 19, 2008, at 2:07 PM, David Avendasora wrote:


On Aug 19, 2008, at 4:43 PM, Chuck Hill wrote:


On Aug 19, 2008, at 12:22 PM, David Avendasora wrote:

Noooooo! Sob. Sniff.

This does sound really similar, but I'm not convinced yet that what I'm doing _should_ work. Here's the exact flow. I'm the only one using the app and I'm using the Default Editing Context.

For review:
ManufacturingSchedule <->> ScheduledRouting
	MS->>SR Owns Destination

I don't think this does anything for to-many relationships. The interplay between Owns Destination and Cascade Delete has always seems confusing to me.

In this situation, Owns Destination is what I'm counting on triggering the deletion of the a ScheduledRouting when the ScheduledRouting's relationship to ManufacturingSchedule is made null - which is very counter-intuitive, because how does the ScheduledRouting know about ManufacturingSchedule's "Owns Destination" relationship back to it?

It would happen, I'd think, in removeObjectFromBothSidesOfRelationshipWithKey. But I am uncertain if that works with to-many.

Why not simply ec.deleteObject(scheduledRoutingToDelete); ?


Rather than removingFromBothSides then saving. Delete, save... you'll find it's removed :-)

Good point, but the ScheduledRouting is really the top of a hierarchy that cascades down from there. ScheduledRouting Cascade Deletes both ScheduledBatch and ScheduledManufacturingOrderItemRouting, SMOIR Cascade Deletes ScheduledManufacturingOrderItems.


With the problem I'm having, If I delete the ScheduledRouting, instead of that Cascading down, I get the validation error on ScheduledBatch that it must have a ScheduledRouting. So it's the same problem, just pushed down another level.

By relying on WO's Cascading Delete and Owns Destination I should be able to simply set one relationship to null and have 50+ instances of various other objects deleted automatically. If I do it all manually, I'm going to end up writing a lot of for-loops to walk through toMany relationships to do all the deleting.


_______________________________________________ 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: Owns Destination problem
      • From: Chuck Hill <email@hidden>
References: 
 >Owns Destination problem (From: David Avendasora <email@hidden>)
 >Re: Owns Destination problem (From: Chuck Hill <email@hidden>)
 >Re: Owns Destination problem (From: David Avendasora <email@hidden>)
 >Re: Owns Destination problem (From: Chuck Hill <email@hidden>)
 >Re: Owns Destination problem (From: David Avendasora <email@hidden>)
 >Re: Owns Destination problem (From: Chuck Hill <email@hidden>)
 >Re: Owns Destination problem (From: Lachlan Deck <email@hidden>)

  • Prev by Date: Single Table inheritance and EM question
  • Next by Date: Re: Protected access modifiers handled differently at runtime in XCode and Eclipse?
  • Previous by thread: Re: Owns Destination problem
  • Next by thread: Re: Owns Destination problem
  • Index(es):
    • Date
    • Thread