conflicting advice about has_a and primary keys
[prev]
[thread]
[next]
[Date index for 2004/05/18]
The CDBI docs contain this piece of advice in the has_a() section:
"*NOTE* You should not attempt to make your primary key column inflate
using has_a() as bad things will happen. If you have two tables which
share a primary key, consider using might_have() instead."
A little further down in the many-to-many section, it breaks this rule.
"First of all we'll set up our Role class:
Role->table('role');
Role->columns(Primary => qw/film actor/);
Role->has_a(film => 'Film');
Role->has_a(actor => 'Actor');
We have a multi-column primary key, with each column pointing to another
class."
Which of these is correct? Or is it just that using has_a() on your
primary key fails if you specify an inflate() method?
- Perrin
|
conflicting advice about has_a and primary keys
Perrin Harkins 18:04 on 18 May 2004
|