Re: Multi column foreign keys
[prev]
[thread]
[next]
[Date index for 2004/09/03]
Y00R0B0T wrote:
> Hello... I'm wondering if anyone on this list had to deal with
> multi-column foreign keys and if so, how'd it go? Did you create your
> own relationship type (ie Class::DBI::Relationship) or did you find a
> work around within standard CDBI?
I've done this quite a bit with no problems. I just made my own simple
method:
sub foreign_obj {
my $self = shift;
my $foreign_obj = Foreign::Class->retrieve(
key1 => $self->key1(),
key2 => $self->key2(),
);
return $foreign_obj;
}
It doesn't do everything that has_a normally does (e.g. this is just a
getter, not a get/set) but you can make it do more if you need to.
Support in has_a would be nice at some point.
- Perrin
|
|
Re: Multi column foreign keys
Perrin Harkins 15:44 on 03 Sep 2004
|