Re: Error accessing columns

[prev] [thread] [next] [Date index for 2004/04/28]

From: Tony Bowden
Subject: Re: Error accessing columns
Date: 15:18 on 28 Apr 2004
On Wed, Apr 28, 2004 at 04:43:08PM +0200, Michele Valzelli wrote:
> I tried to make it as simpler as possible to help you reproduce the problem. 

Thanks.

When I test this I also get the message:
  Column 'id' in Messagenet::DBI::Fattura clashes with built-in method 

The problem is that Class::DBI doesn't allow you to call a column 'id'
unless it's your primary key. In your case 'id' is only *part* of your
primary key, and so CDBI gets very confused.

The easiest workaround if you can't change the schema is to override
the accessor name for your 'id' column:

	sub accessor_name {
		my ($self, $column) = @_;
		return "myid" if $column eq "id";
		return $column;
	}

Tony

Error accessing columns
Michele Valzelli 12:57 on 28 Apr 2004

Re: Error accessing columns
Tony Bowden 13:20 on 28 Apr 2004

Re: Error accessing columns
Michele Valzelli 14:43 on 28 Apr 2004

Re: Error accessing columns
Tony Bowden 15:18 on 28 Apr 2004

Re: Error accessing columns
Michele Valzelli 16:05 on 28 Apr 2004

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