Re: commit on a table with no PK

From: Mike Kienenberger (mkienen..mail.com)
Date: Mon May 10 2010 - 20:58:31 UTC

  • Next message: Marek Ĺ ab: "Setting Charset"

    You can just mark every field as a natural primary key.
    That's really what you're doing in practice anyway when you mark nothing as one.

    On Mon, May 10, 2010 at 4:52 PM, <MGargan..scholar.com> wrote:
    > understood.  makes sense.  i just figured since i was doing inserts only i
    > could get away with it, since the modeler was only giving warnings.
    > thanks.
    >
    > -mike
    >
    >
    >
    >
    > From:
    > Michael Gentry <mgentr..asslight.net>
    > To:
    > use..ayenne.apache.org
    > Date:
    > 05/10/2010 04:30 PM
    > Subject:
    > Re: commit on a table with no PK
    >
    >
    >
    > If you don't have a unique key then Cayenne could really mess things
    > up with you do an UPDATE.
    >
    > On Mon, May 10, 2010 at 4:27 PM,  <MGargan..scholar.com> wrote:
    >> it can't be the data because it's not necessarily unique.  so cayenne
    >> always needs at least surrogate key?  oh, pooh.  :-/
    >>
    >> -Mike
    >>
    >>
    >>
    >>
    >> From:
    >> Michael Gentry <mgentr..asslight.net>
    >> To:
    >> use..ayenne.apache.org
    >> Date:
    >> 05/10/2010 04:16 PM
    >> Subject:
    >> Re: commit on a table with no PK
    >>
    >>
    >>
    >> You need a key of some kind ...  Is your key natural data?  If so, set
    >> it yourself and Cayenne will use it..
    >>
    >> On Mon, May 10, 2010 at 4:12 PM,  <MGargan..scholar.com> wrote:
    >>> Hi all,
    >>>
    >>>        I'm creating a new object for a table with no PK.  The object's
    >>> properties are properly set, but when I do the commit I get this....
    >>>
    >>>
    >>>
    >>> org.apache.cayenne.CayenneRuntimeException: [v.3.0RC2 Jan 30 2010
    >>> 16:41:40] Temporary ID hasn't been replaced on commit:
    >>> {<ObjectId:MsuEdmInbox, TEMP:000001CB0B8C0C3D>; new; [outputFileName=>
    >>> ...property map cont.
    >>>
    >>>
    >>> Any ideas?
    >>>
    >>> Thanks.
    >>> -Mike
    >>>
    >>
    >>
    >>
    >
    >
    >



    This archive was generated by hypermail 2.0.0 : Mon May 10 2010 - 20:59:21 UTC