[CDBI] add_column - bug or feature?

Peter Speltz peterspeltz at gmail.com
Mon Jan 9 20:08:52 GMT 2006


Opps I forgot I have a personal hack in the file I attached so that
the child class always gets its PK set  to the parent's PK . This is
because currently you cannot  setup IsA on a PK. Any ideas on a nice
interface to allow this option would be appreciated. I'm thinking an
extra argument when you set up the relationship -- "1:1" or "1:M" may
prove useful. If IsA  knows that it is a one to one, for example,  it 
could always set the PKs the same in parent and child and cascade
delete  the parent

Beer->is_a(drink_id => "Adult::Beverage", '1:11' one_to_one'

 .
Anyway look for the lines

# pjs -- want pks same for isa #############################
    $self->_attribute_store($self->primary_column => $f_obj->id);
############################################################

and comment out.

cheers


On 1/9/06, Peter Speltz <peterspeltz at gmail.com> wrote:
> On 1/9/06, Kate Yoak <kate at longmedia.com> wrote:
> >
>
> > $class->__grouper->add_group(TEMP => $accessor);
> > I swiped this from Relationship::IsA whose code hasn't change as far as I
> > can tell - and it probably fails too.
> >
>
> I thought this was  strange too. Not sure whether this is a bug of
> feature. I think is is preparation for the future versions where
> column objects will be powerful tools (if I understand the direction
> CDBI is heading correctly)  I have just  taken over IsA and have a
> patched version  I have been using on CDBI 3.12.  I am about to take
> all the debugging statements out or  make them optional is probably
> more like it because I'm sure i will need them sometime.  Attached is
> the patched version and let me know if it does not work for 3.13 .
> Also email me if you want an IsA version without the debugging
> statements. It may be a week before I have it on an SVN server .
>
>
> > Cheers,
> > Kate
> > _______________________________________________
> > ClassDBI mailing list
> > ClassDBI at lists.digitalcraftsmen.net
> > http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi
> >
> >
> >
>
>
> --
> pjs
>
>
>


--
pjs




More information about the ClassDBI mailing list