Re: FW: many to many help

[prev] [thread] [next] [Date index for 2004/06/09]

From: Tony Bowden
Subject: Re: FW: many to many help
Date: 19:44 on 09 Jun 2004
On Wed, Jun 09, 2004 at 01:34:59PM -0600, Bruner, Todd wrote:
> OK, I now know that the XYZ::Links needs to be before XYZ::Things if they
> are in the same file.  However, I still run into a problem with cascading
> delete.  Namely, as coded below, the cascading delete will only delete the
> rows in the Links table with srcThingId = to target, and ignores rows in the
> Links table with dstThingId = to target.

I'm still not sure I understand the set-up, but I think you want two
different has_many declarations, one to match each of the has_a() ones:

You currently have:

> XYZ::Links->has_a(srcThingId => 'XYZ::Things'); 
> XYZ::Links->has_a(dstThingId => 'XYZ::Things');

and
> XYZ::Things->has_many(links => 'XYZ::Links');

But you probably want 
  XYZ::Things->has_many(src_links => 'XYZ::Links', 'srcThingId');
  XYZ::Things->has_many(dst_links => 'XYZ::Links', 'dstThingId');

Tony

FW: many to many help
Bruner, Todd 19:34 on 09 Jun 2004

Re: FW: many to many help
Tony Bowden 19:44 on 09 Jun 2004

Re: FW: many to many help
Vince Veselosky 21:05 on 09 Jun 2004

Re: FW: many to many help
Tony Bowden 22:02 on 09 Jun 2004

Re: FW: many to many help
Vince Veselosky 17:48 on 15 Jun 2004

Generated at 11:34 on 01 Dec 2004 by mariachi v0.52