Re: Identity PK value

From: Mike Kienenberger (mkienen..mail.com)
Date: Fri Jun 15 2007 - 10:14:00 EDT

  • Next message: yongbl: "Common attributes in the model"

    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 <andru..bjectstyle.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
    >



    This archive was generated by hypermail 2.0.0 : Fri Jun 15 2007 - 10:14:25 EDT