[Catalyst] Class::DBI::Sweet search method error?

Maxim Nechaev nechaev at technodesign.ru
Wed Apr 5 04:13:48 CEST 2006


Hi.
Maybe this wrong list for my question but SUPPORT section of `perldoc
Class::DBI::Sweet` point on it.

I have some Class::DBI based module with own column accessor names:
package UserAgent;
use base 'Class::DBI';
....
__PACKAGE__->columns
(
    'Essential', 
    Class::DBI::Column->new(txtLog   => {accessor => 'log'  }),
    Class::DBI::Column->new(intCount => {accessor => 'count'}),
    Class::DBI::Column->new(lstType  => {accessor => 'type' }),
    Class::DBI::Column->new(lstName  => {accessor => 'name' }),
);

Search and access through modified accessors work fine:
my @mobileAgents = UserAgent->search(type => 'mobile');
print $mobileAgents[0]->name;

But if i try switch base module to Class::DBI::Sweet i get error message
in search method: "DBD::mysql::st execute failed: Unknown column
'me.type' in 'where clause'" When i change to real column name "lstType"
all works again. Look like "Class::DBI::Sweet" ignore customized columns
accessors. Is there any work arounds for this? Can i have different
column names in my table and in my "Class::DBI::Sweet" class?

Thanks.


--
Maxim Nechaev





More information about the Catalyst mailing list