Re: validating deleting an object with relationship
Re: validating deleting an object with relationship
- Subject: Re: validating deleting an object with relationship
- From: Chuck Hill <email@hidden>
- Date: Tue, 19 Jan 2010 08:46:40 -0800
On Jan 18, 2010, at 11:51 PM, Johan Henselmans wrote:
On 19 jan 2010, at 01:54, Chuck Hill wrote:
On Jan 18, 2010, at 4:49 PM, Johan Henselmans wrote:
I want to delete an EO object only if some data is not available
in one of its relationships.
Can you not use a delete rule? Deny is what you want.
No, at least from my understanding the deny delete rule is based on
the fact that there are still entities on the other side of the
relationship. Or is there some ways to programmatically tell that
the denty rule to be triggered based on a date?
That was not very clear from your original problem statement. :-)
Basically I do not want entities to be deleted with relationships
that have have a changedate in the past, only current and future
entities may be deleted. (I am building a time machine and I want to
make sure nobody can delete the goats on our famous island in the
pacific)
It sounds more like you want to implement validateForDelete() on the
related EO with the date, not the root object. Check the changeDate
and throw if it is not in the past.
But, IIRC, that won't happen until saveChanges(). Not sure, coffee is
brewing right now.
Chuck
validateForDelete() can not be used, because before that us called
the relations have already been obliterated.
mightDelete() gives the required info, but does not raise a
validation exception.
How does one raise a validation exception in this situation, so
that it will give these nice Yellow messages in a direct To Web
Application?
<PastedGraphic-1.png>
Johan Henselmans
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
Regards,
Johan Henselmans
http://www.netsense.nl
Tel: +31-20-6267538
Fax: +31-20-6279159
--
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
_______________________________________________
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