RE: TEMP fields behaviour
[prev]
[thread]
[next]
[Date index for 2005/01/17]
Couldn't you do something like this?
__PACKAGE__->columns(TEMP => (__PACKAGE__->columns("TEMP"), qw(foo bar)));
This would first get a list of the temp columns, add your columns to it, and
then set the temp columns to the old plus new columns. I haven't tried it,
but I don't see why it or some variation on it wouldn't work and you
wouldn't be shot in the foot later if the method the underlying base class
used to store data changed at a later date and would not violate object
oriented principles.
-----Original Message-----
From: Hartmaier Alexander [mailto:Alexander.Hartmaier@xxxxxxxxx.xx]
Sent: Monday, January 17, 2005 5:42 AM
To: class dbi list
Subject: Re: TEMP fields behaviour
Hi!
I looked into DBI.pm from Class::DBI to understand how the object values are
stored from the DBI hash.
After that I figured out that my additional 'temp' field 'since' is called
'datetime_from' in the sql view.
So I renamed my temp field from 'since' to 'datetime_from' and
out-of-the-box it gets filled with the right value ;-)
I'm still looking for an example how to subclass an Class::DBI class...
-Alex
-----Ursprüngliche Nachricht-----
Von: Peter Speltz [mailto:peterspeltz@xxxxx.xxx]
Gesendet: Freitag, 14. Januar 2005 17:59
An: class dbi list
Betreff: Re: TEMP fields behaviour
--- Perrin Harkins <perrin@xxxx.xxx> wrote:
> Peter Speltz wrote:
> > If your CLASS is_a something else (uses the is_a relationship) you can't
> set
> > TEMP cols in your CLASS (in my experience a few months ago anyway). One
or
> the
> > other sets of TEMP columns trumps rather than them being merged but i
can't
> > remember which.
>
> All Class::DBI objects use @ISA. Do you mean that if you class and a
> class it inherits from both have a TEMP declaration that it won't work?
> That would make sense to me.
>
:) terminology is fun. No. I mean "is_a" in the class dbi sense ie it uses
the
Class::DBI::Relationship::IsA to inherit from another class.
I'd also expect a class's TEMP columns or any other declarations to override
any that it inherits via @ISA.
> No virus found in this outgoing message.
> Checked by AVG Anti-Virus.
> Version: 7.0.300 / Virus Database: 265.6.11 - Release Date: 1/12/2005
>
>
=====
pjs
__________________________________
Do you Yahoo!?
Yahoo! Mail - Helps protect you from nasty viruses.
http://promotions.yahoo.com/new_mail
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"
*
Hinweis: Dieses E-mail kann vertrauliche und geschützte Informationen
enthalten.
Sollten Sie nicht der beabsichtigte Empfänger sein, verständigen Sie bitte
den Absender und löschen Sie dieses E-mail dann sofort.
Notice: This e-mail contains information that is confidential and may be
privileged.
If you are not the intended recipient, please notify the sender and then
delete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"
*