How do I know when an EOEnterpriseObject is removed from an Editi ng Context?
How do I know when an EOEnterpriseObject is removed from an Editi ng Context?
- Subject: How do I know when an EOEnterpriseObject is removed from an Editi ng Context?
- From: "MacMullin, Jake (DCS)" <email@hidden>
- Date: Thu, 9 Jan 2003 10:52:41 +1030
Hi,
I need to do some database manipulation with raw SQL when my objects are
created - so I have overridden awakeFromInsertion to write some stuff to the
DB when my objects are inserted into an editing context. I also need to do
some cleaning up if the object is deleted - so I have overridden
validateForDelete to use raw SQL to delete the stuff from the database. This
works beautifully. Whenever I create an object it writes the stuff I want to
the DB and when it is deleted it cleans up after itself.
However, I have stumbled across a problem. What do I do if the object is
created and inserted in to the editing context, but then the changes are
discarded, like if the 'Cancel' button is pressed in a Direct2Web app or by
revert() being called on the editing context. It seems like the
validateForDelete method isn't called in this case. So how do I know when
one of my custom EOEnterpriseObjects is discarded in this manner?
Regards,
Jake MacMullin
This e-mail is personal. It is not authorised by, nor sent on behalf of, the
Government of South Australia.
_______________________________________________
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.