in reply to Class::DBI has_a() relationships with multi-value keys

Don't worry, it's easy.
sub foreign_obj { my $self = shift; my $foreign_obj = Foreign::Class->retrieve( key1 => $self->key1(), key2 => $self->key2(), ); return $foreign_obj; }

Replies are listed 'Best First'.
Re^2: Class::DBI has_a() relationships with multi-value keys
by MrCromeDome (Deacon) on Oct 29, 2004 at 21:20 UTC
    So do I do that in my parent class? If so, what does it look like in the child's definition? Or did I miss something? ;)

    MrCromeDome

      You just do that in the parent class, i.e. the one that is holding a copy of other class' primary key in its table. If you want a has_many method in the child class that goes the other way, you could code one of those too, using a search() instead of retrieve().