Re: more on inherited classes

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

From: Tony Bowden
Subject: Re: more on inherited classes
Date: 06:38 on 28 Jul 2004
On Tue, Jul 27, 2004 at 06:33:16PM -0400, Dana Hudes wrote:
> I get the same behavior: create and retrieve return a hash with only 
> subject_id, the primary key.
> I looked into this and found that in Class::DBI::_create
> everything was getting tossed out and I don't understand why.
> Temp columns yes I could see maybe. But the contents of $real?
> Leaving me with only my primary key fields? Why?

This is deliberate.

After you insert something to the database, Class::DBI has no way of
knowing what the database actually holds. There are lots of reasons why
the database would change what you give it: default values may kick in,
values may be truncated to fit column lengths, triggers may completely
change everything, etc. So we just discard everything and re-fetch it
when next requested to make sure we have the correct values.

The create() trigger allows you to change this behaviour.

Tony

more on inherited classes
Dana Hudes 22:33 on 27 Jul 2004

RE: more on inherited classes
Dana Hudes 01:33 on 28 Jul 2004

Re: more on inherited classes
Charles Bailey 01:48 on 28 Jul 2004

Re: more on inherited classes
Dana Hudes 02:03 on 28 Jul 2004

Re: more on inherited classes
Tony Bowden 06:38 on 28 Jul 2004

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