Re: Owns Destination problem
Re: Owns Destination problem
- Subject: Re: Owns Destination problem
- From: David Avendasora <email@hidden>
- Date: Tue, 19 Aug 2008 17:07:12 -0400
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?
I need more coffee. Or at this point maybe beer is the better answer.
Did I just say "maybe"?
MS ->>SR Cascade Delete Rule
SR->MS is required by SR
SR->MS Nullify Delete Rule
1) Create a new ManufacturingSchedule
2) saveChanges().
3) Create a new ScheduledRouting, assign the new
ManufacturingSchedule to it's manufacturingSchedule() relationship
using: addObjectToBothSidesOfRelationshipWithKey(object,
MANUFACTURING_SCHEDULE_KEY);
4) remove the ScheduledRouting from the ManufacturingSchedule using:
removeObjectFromBothSidesOfRelationshipWithKey(object,
SCHEDULED_ROUTINGS_KEY);
The "object" in 3 and 4 are different objects, right?
Yes, in 3 it is a ManufacturingSchedule and in 4 it is a
ScheduledRouting - I just copied the lines out of the _Entity.java
files so there would be no doubt that I'm doing the whole "both sides"
thing. Cuz I knew you'd ask.
5) saveChanges()
This gives me the validation exception. Should it work, or is this
actually the expected behavior?
I would expect it to work.
If I add a saveChanges() between steps 3 and 4, then it saves both
without any problem after the removal.
No matter how you slice it, that is buggy behavior. For once, it
might not be you. ;-)
Whew. Thank- HEY! Wait a minute . . . that, that, that... is about
accurate. I guess.
I'll file a bug with Apple.
Where's that beer?
Dave
_______________________________________________
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