Re: Oracle Sequence Exception Question

From: Mike Kienenberger (mkienen..laska.net)
Date: Tue Oct 21 2003 - 16:43:54 EDT

  • Next message: Mike Kienenberger: "Re: Oracle Sequence Exception Question"

    Todd Costella <Todd.Costell..ntero.com> wrote:
    > Well, that makes sense now doesn't it. You mean the model doesn't figure
    > this out by itself by reading my mind? <grin>
    >
    > I'm gettng closer. The exception I currently get is
    >
    > <snip>
    >
    > Caused by: java.sql.SQLException: ORA-01400: cannot insert NULL into
    > ("OMNI_TRACK"."OMNI_TRACK_NOTES"."ID")
    >
    > </snip>
    >
    > The id column is the primary key that should be populated by the
    > sequence relationship defined below. I am assuming that the framework
    > will populate the column in the insert via the sequence given the
    > relationship. Is this true or do I have do perform a "set" on the id
    > after making a call to generate the sequence myself?

    If it's marked in the model as a non-class attribute (ie, no object entity
    attribute for the primary key) and a primary key, and you've specified the
    oracle sequence info, it should be automatic.

    Also, if you're using sequences generated by WebObjects, they are probably
    set up with an increment value of 1, not the increment value of 20 which is
    the default in the Cayenne modeler. Unfortunately I didn't keep a copy of
    your original message so I don't remember to what you had it set.



    This archive was generated by hypermail 2.0.0 : Tue Oct 21 2003 - 16:43:13 EDT