Re: more on inherited classes
[prev]
[thread]
[next]
[Date index for 2004/07/28]
On Tue, 27 Jul 2004, Charles Bailey wrote:
> --On Tuesday, July 27, 2004 6:33 PM -0400 Dana Hudes
<dhudes@xxxxxx.xxxx>
> wrote:
>
> > Problem 1: the Essential columns of the parent are not included in the
> > query
>
> That's true of all column groups -- CDBI doesn't really take inheritance
> into account when dealing with the connection between a class and a
table.
> (I don't know whether that's a philosophical stance or just a detail of
the
> current implementation.) You could probably change this by overriding
> appropriate methods (at least group_cols, groups_for, and all_columns)
in
> Class::DBI::ColumnGrouper to account for columns from the superclass.
I'm looking into this now...
>
> > Problem 2: _create guts the created object leaving only the primary
key
> > behind .
>
> I think the rationale here was that later use of non-key accessors would
> pick up any changes that had been made to the database by another
process.
> Once a column group is read (by calling an accessor for a column in that
> group), outside changes to the DB are invisible until the object is
updated
> or cleared from the cache.
I can get the value of a child column with its accessor after gutting.
I cannot get a value for a column defined in a parent class.
If we have Person , with attribute 'id' and 'name', and Policeman inherits
from Person (ISA person) and defines some column 'rank' then
I am able to get the value of 'rank', of 'id' but not of 'name',
the value is undef . The method for name is defined it just returns undef.
I suspect this is related to Essentials. I saw the sql generated
didn't include parent columns other than primary key.
>
> --
> Regards,
> Charles Bailey < bailey _at_ newman _dot_ upenn _dot_ edu >
> Newman Center at the University of Pennsylvania
>
|
|
Re: more on inherited classes
Dana Hudes 02:03 on 28 Jul 2004
|