Set join column to null after removing the related row? [message #524275] |
Wed, 31 March 2010 11:46 |
|
Hi,
I have a one-to-one relationship and want to set the join column of this relation to null if the related row was removed. At the moment I just found ways to cascade which removes the row in the child table. I need a way to say it in SQL like "ON DELETE SET NULL".
All what I try removes the child row(cascade, orphan-removal, private-owned, ...). Any suggestions what I have to do? Thanks in advance!
regards
Christian
|
|
|
|
Re: Set join column to null after removing the related row? [message #524742 is a reply to message #524634] |
Fri, 02 April 2010 07:52 |
|
Hello Chris,
thanks for you reply!
That means I needn't to create any relation (one-to-one, ...) but I have to set to "null", with the event methods, manually, haven't?
What I want to do: I'll link an "Account" with the corresponding "Session". Account has a Column "FK_SESSION_ID", this column I need to set to null if the session expire or becomes invalid otherwise. Should I realize it on another way or is my intention the right way? I just want that one Account can only have one or none Session.
best regards
Christian
|
|
|
Powered by
FUDForum. Page generated in 0.03584 seconds