On 4/24/07 11:50 AM, Ovid wrote:
> I have a 'server' object. There's a 'suspension' table which has an optional
> single record for each server. If a server is suspended, the table gets a
> record of metadata for why the server was suspended. When the server is
> unsuspended, we delete said record. In my server class, I have this:
>
> relationships => [
> suspended => {
> class => 'My::Server::Dedicated::Suspended',
> column_map => { server => 'server' },
> type => 'one to one', # should be one to optional one
> },
> ],
>
> [...] How can I have my server delete the suspended record without the server
> ID going away?
This is probably the best way to do it:
$server->delete_suspended;
$server->save;
Unfortunately, in your example, that will fail (I think) because a column in
the left-hand side of the column_map in the suspended relationship is part
of the primary key of the server class. I'll try to add a fix for this
soon. Any strong feelings about how it *should* behave?
-John
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Rose-db-object mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rose-db-object