cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike Kienenberger" <mkien...@gmail.com>
Subject Re: Identity PK value
Date Fri, 15 Jun 2007 14:14:00 GMT
Another possibility might be to remove the column from being
auto-generated by Cayenne, and manually set the primary key value as a
normal attribute.

On 6/15/07, Andrus Adamchik <andrus@objectstyle.org> wrote:
>
> On Jun 15, 2007, at 4:56 PM, Marc Gabriel-Willem wrote:
>
> >  I would like to have the PK value before the commit ! Is there
> > any way to do that ?
>
> Unfortunately no, as JDBC driver returns it only after the row is
> inserted. If what you want to do is modify this or some other object
> in the same transaction, you can achieve that using custom
> transactions wrapping multiple context.commitChanges() calls. This
> requires a bit of extra code though:
>
>    http://cayenne.apache.org/doc/understanding-transactions.html
>
> Andrus
>

Mime
View raw message