Reblessing question: change primary key name?
[prev]
[thread]
[next]
[Date index for 2005/01/09]
Hello,
I'm sure this has been talked about before, but I can't seem to be able
to find the conversation.
I'm trying to rebless an retrieved C:DBI object into a subclass of its
original class that adds some (non-Essential) columns, removes some
columns (no problems with those two) and changes the name of the primary
key (that one's a problem).
I don't want to change the value of the primary key (a big no-no from
what I understand), just the name. Most importantly the reblessing
procedure should not hit the database at all (until the object goes to
lazily fetch the new column group defined in the subclass).
Is there a way to rename the column name, its accessor and mutator? I
don't care if the old value is still there, as long as it doesn't try to
fetch the old column on the next database trip.
Another approach I am thinking of is to ->construct() the new object I
want from scratch, but this requires overloading the constructors and
I'd much rather do the reblessing from a 'select' trigger (seems like
it'd be faster, too).
Any suggestions?
Sorry if this has been talked about to death, I can't seem to find
anything relevant in the archives.
Dmitri
|
Reblessing question: change primary key name?
Dmitri Bichko 23:33 on 09 Jan 2005
|