On 4/19/06, Doug Hughes <[EMAIL PROTECTED]> wrote:
> The following code will delete the user but not the address.
>
> <cfset user.delete() />
>
> The following code will cause a dbms-specific constraint error to be thrown.
> You can't delete the user's address.
>
> <cfset user.getAddress().delete() />

OK. Is there any thought of adding cascading delete so that the first
code *would* also delete all related sub-objects?

> <cfset address = user.getAddress() />
> <cfset user.removeAddress() />
> <cfset user.save() />
> <cfset address.delete() />
>
> (Should removeAddress return the address that was removed?  Akin to a pop()
> method?)

Yes, please. Then I can do this:

<cfset user.removeAddress().delete() />
<cfset user.save() />
--
Sean A Corfield -- http://corfield.org/
Got frameworks?

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood



-- Reactor for ColdFusion Mailing List -- [email protected]
-- Archives at http://www.mail-archive.com/reactor%40doughughes.net/


Reply via email to