cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aristedes Maniatis <>
Subject Re: Obtain primary key for DataObject before commitChanges
Date Mon, 10 Aug 2015 11:27:02 GMT
On 10/08/2015 8:31pm, Hugi Thordarson wrote:
> Is it possible for me to obtain the primary key for a Cayenne DataObject before committing
changes? I’m writing an audit log and I need the key for the object during PrePersist (where
I’m constructing the log object).

How will it have a primary key before the record is written to the database? Or do you want
to hang onto the temporary ObjectId and then replace it with the real PK after the commit?


Aristedes Maniatis
GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A

View raw message