Re: [CDBI] has_a relationship with non-primary column?

"Perrin Harkins" <[email protected]> Wed, 5 Sep 2007 14:47:12 -0400
Newsgroups gmane.comp.lang.perl.modules.class-dbi
Message-ID <[email protected]>
On 9/5/07, Praveen Hombaiah <[email protected]> wrote:
> I should have mentioned that not only is this a non-primary key as far as
> the database is concerned but a non-primary key in the class-dbi code as
> well.

That should always be true.  You shouldn't need to lie to Class::DBI
about what your primary keys are.

> # Is it possible to link this relationship with employee.desired_column
> instead of
> # employee.real_pk?
> __PACKAGE__->has_a( department => 'Department' );

The first argument to has_a is the column name, so that should be
'desired_column', not 'department.'

- Perrin