palette has asked for the wisdom of the Perl Monks concerning the following question:

Hi
I am using DBIx::Class in my project. I have defined a set of table and relation between them using DBIx::Class. Now I am trying to query the table 1 and fetching a record. I need to make duplicate of that record of table1. I am making use of the copy method in DBIx::Class.
But it seems DBIx::Class also take the relation with other table ie; table2 and also makes a copy of that table which in my case causes problem. I just wanted to make a copy of the table1 and not cascade the child tables. Can anyone tell me how can I acheive this.

Replies are listed 'Best First'.
Re: copy in DBIX:Class
by castaway (Parson) on Apr 16, 2007 at 12:39 UTC
    Set "cascade_copy => 0" in your relationship attributes, that will prevent it from copying them.

    C.

      __PACKAGE__->has_many(o=> 'DSLP2::Main::O','id',{cascade_copy=>0})

      will this work.