Re: abstract class with Class::DBI

[prev] [thread] [next] [Date index for 2004/10/22]

From: Perrin Harkins
Subject: Re: abstract class with Class::DBI
Date: 16:09 on 22 Oct 2004
On Thu, 2004-10-21 at 10:17, Tom Hukins wrote:
> The attached script demonstrates problems with setting has_a
> relationships on a primary key field.  As provided, the script runs
> fine, but uncomment the relationship on line 39 and it breaks.
> 
> Can you think of an elegant way to specify the relationship that
> avoids problems?

I work around this by giving the column accessor a special name (say,
"owner_id" instead of "owner") and then writing my own accessor for the
object.

package House;

sub owner {
    my $self = shift;
    return Person->retrieve( $self->owner_id() );
}

- Perrin

(message missing)

abstract class with Class::DBI
Edward Betts 15:09 on 20 Oct 2004

Re: abstract class with Class::DBI
Tom Hukins 16:40 on 20 Oct 2004

Re: abstract class with Class::DBI
William McKee 13:00 on 21 Oct 2004

Re: abstract class with Class::DBI
Tom Hukins 14:17 on 21 Oct 2004

Re: abstract class with Class::DBI
Perrin Harkins 16:09 on 22 Oct 2004

Re: abstract class with Class::DBI
Tony Bowden 14:41 on 21 Oct 2004

Re: abstract class with Class::DBI
William McKee 18:54 on 21 Oct 2004

Re: abstract class with Class::DBI
Michael 19:17 on 21 Oct 2004

Re: abstract class with Class::DBI
Andreas Fromm 07:00 on 21 Oct 2004

Re: abstract class with Class::DBI
William McKee 19:42 on 21 Oct 2004

Re: abstract class with Class::DBI
Kingsley Kerce 20:01 on 21 Oct 2004

Re: abstract class with Class::DBI
Perrin Harkins 16:14 on 22 Oct 2004

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