Re: Setting an attribute based on PK?

Ashley Aitken <[email protected]> Sun, 25 Apr 2004 21:07:28 +0800
Newsgroups gmane.comp.web.webobjects.eof
Message-ID <[email protected]>
In these days and times, is the first sign of madness replying to your 
own posts?

On 25/04/2004, at 4:16 PM, Ashley Aitken wrote:
> I want to set an attribute (not the primary key) based on the 
> primaryKey value.  But, of course, the primary key is not generated 
> until during the initial saveChanges.

Just saw some code on WODev (thanks to all who have created that 
wonderful resource) for generating primary keys on insert.  I will try 
that and see how it goes.

Of  course, the downside is that the primary keys may not get used (ie 
no saveChanges) and you lose any sequencing/counting on the primary key 
(but then it is supposed to be database-specific not app-specific).

If anyone can tell me why the method I originally tried (using the 
primary key after it was generated on a saveChanges) didn't work, or a 
better way to do what that, I would be most grateful.

Thanks to all those who have replied to my post ;-)

Cheers,
Ashley

--
Ashley Aitken
Perth, Western Australia
mrhatken at mac dot com