Re: [Modeling-users] Foreign Keys
Status: Abandoned
Brought to you by:
sbigaret
From: Sebastien B. <sbi...@us...> - 2003-07-23 13:02:27
|
Yannick Gingras <yan...@sa...> wrote: > On July 21, 2003 11:41 am, Sebastien Bigaret wrote: > > > > Is there a way to do it without breaking anything ? > > > > > > Of course there is a way, just set the foreign key to be class proper= ty. > > > > > > Forgive me to post before proper re-caffeination ! > > > > Oh oh, here you can get into very serious troubles. Demonstration, using > > test package AuthorBooks where I made Book's FK_Writer_Id a class >=20 > You're just too right ! re-caffeination is so slow after those lan > parties... He he [...] > > That's an illustration of why PKs and FKs should be considered > > *read-only* when they are made class properties, as stated in the faq > > [http://modeling.sf.net/UserGuide/faq-change-class-location.html]. >=20 > I might be nice to raise when trying to set a read-only property. While this could be done, I'm 90% sure this is not a good idea ;) I'm thinking of two reasons: 1. it would add additional cpu-times for a feature most users do not need, 2. when it becomes possible to provide your own generation scheme for generating PKs, it is possible that you'll use this attribute for storing the id to be used at saveChanges() time. -- S=E9bastien. |