On 12/22/06 1:40 PM, Chris Campise wrote:
> The way I understood the above to work was that it would insert a new Parent
> row and then auto-insert ONE (1) Child row with the child.parent_id foreign
> key pointed back to parent.parent_Id.  But there are two Child rows being
> inserted, and neither have the child.notes field populated

You don't specify any values for the primary keys here:

> my $p = My::DB::Parent->new(
>     notes => "These are some parent notes")->save;
> 
> $p->child(notes => "These are some child notes");
> $p->save;

If those calls actually work, then the pk columns are likely AUTO_INCREMENT
in the database, in which case the column type in your classes should be
"serial", not "integer".

If I've missed something, please post the table definitions and I'll see if
I can reproduce your situation on my end.

-John

> package My::DB::Parent;
...
>   columns =>
>   [
>     parent_id => { type => 'integer', not_null => 1 },
...
> package My::DB::Child;
...
>   columns =>
>   [
>     child_id  => { type => 'integer', not_null => 1 },



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object

Reply via email to