I've taken this for a quick spin and it seems to basically work, though it is not ready for prime time in the immediate future.
Any comments on whether I'm on the right track here would be greatly appreciated.
For now I'll be testing this inhouse while we're developing an application.
I tried to create a patch, but I couldn't connect to the sourceforge CVS server, hence the .zip file:
cvs -d:pserver:email@example.com:/cvsroot/cayenne login
Logging in to :pserver:firstname.lastname@example.org:2401/cvsroot/cayenne
cvs [login aborted]: end of file from server (consult above messages if any)
Basically issuing a "SELECT @ @IDENTITY" after inserting a record with a generated column will return the generated key. The limitation is that this can only work with a single generated column.
Tore Halset gave me a few pointers to get as far as I did, including his results of some googling: