[CDBI] Changing Your Column Accessor Method Names

Derek Basch <dbasch-/[email protected]>
Newsgroups gmane.comp.lang.perl.modules.class-dbi
Message-ID <[email protected]>
Everyone,

I am gettting this error message:

Column 'id' in Database::Tql::Custdb clashes with built-in method at
class_dbi_test.pl line 26

and can't quite figure out how to fix it. I see there are several
solutions listed in the wiki:

http://wiki.class-dbi.com/wiki/Overriding_autogenerated_accessors

But they don't seem to do anything. Am I doing this (below) all wrong?

use strict;
use warnings;
use MysqlClientConfiguration;

package Database::Tql::DBI;
use base 'Class::DBI';

#sub id {
#   my $self = shift;
    # Back to normal Class::DBI
#    return $self->_id_accessor(@_);
#}

sub accessor_name {
  my ($class, $column) = @_;
  return "user_id" if $column eq "id";
  return $column;

}

Database::Tql::DBI->connection('dbi:mysql:Tql',
$MysqlClientConfiguration::mysql_user,
$MysqlClientConfiguration::mysql_password);

Thanks,
Derek Basch 

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.