Re: NULL being set for PK on ec.deleteObject()?
Re: NULL being set for PK on ec.deleteObject()?
- Subject: Re: NULL being set for PK on ec.deleteObject()?
- From: Chuck Hill <email@hidden>
- Date: Thu, 24 Mar 2005 08:56:16 -0800
On Mar 24, 2005, at 5:26 AM, Drew Thoeni wrote:
I have a main object (Student) with several related objects (Address,
PaymentMethod, and StudentClasses). The slightly different thing is
Address also has a relationship with PaymentMethod.
Cascade delete rules have been set in Frontbase so, when deleting a
Student in Frontbase, all associated rows are properly removed.
Unless you are working on an optimization, I would avoid doing this at
the database level.
When I attempt to delete Student in WO and review the SQL logging, the
Student and StudentClasses are removed, but the Address and
PaymentMethod are not. I suspect this is due to the relationship
between them.
Since there is not a method of informing EOModeler about cascade rules,
There are delete rules on relationships. You want the one called
Cascade. :-) This will delete the related objects for you at the
expense of fetching them but with the benefit of validateForDeletion
and keeping the object graph consistent.
to solve this I have picked these arrays (Address and PaymentMethod)
from Student and incremented through them, deleting each one
specifically.
Question: Is this the proper method?
No, you should not need to do this.
Chuck
--
Practical WebObjects - a book for intermediate WebObjects developers
who want to increase their overall knowledge of WebObjects, or those
who are trying to solve specific application development 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