Overloaded Class::DBI packages
Mark Hughes
mhsparks at gmail.com
Mon Jul 24 11:16:36 BST 2006
On 7/21/06, Simon Wistow <simon at thegestalt.org> wrote:
> I have a bunch of Class::DBI based objects that work just fine.
>
> package Foo;
>
> __PACKAGE__->table('foo');
> __PACKAGE__->columns('id', 'bar');
> # etc etc
>
> 1;
>
>
> However now I want to have
>
> package DebugFoo;
>
> use base qw(Foo);
> __PACKAGE__->table('debug_foo');
>
> 1;
>
> where the table overload_view is exactly the same as foo only wiht debug
> info in.
>
> However that gives me a load of errors along the lines of
>
> 'bar' method already exists.
>
> and
>
> Can't call method "prepare_cached" on an undefined value at
> /usr/lib/perl5/site_perl/5.8.3/Ima/DBI.pm line 391.
>
> and
>
> Can't use an undefined value as a HASH reference at
> /usr/lib/perl5/site_perl/5.8.3/Class/DBI/Relationship/HasMany.pm line 51
>
> and
>
> Can't locate object method "meta_info" via package
>
>
>
> Any ideas?
>
What version of Class::DBI are you using?
Our application uses a lot of subclassing of Class::DBI classes, and
we've stuck with Class::DBI::Frozen::301 as later versions were
causing us some issues which I've not had time to get to the bottom of
yet.
More information about the london.pm
mailing list