RE: Fetching a NextVal to be used in an insert

From: Williams, Beth (beth.william..FIB.ORG)
Date: Mon Nov 01 2004 - 14:48:22 EST

  • Next message: Bryan Lewis: "Re: Fetching a NextVal to be used in an insert"

    I will try what Andrus suggests, removing the personId ObjAttribute from the mapping. I will try this in the morning once the database is available again. Thanks.

    Beth

    -----Original Message-----
    From: Gentry, Michael [mailto:michael_gentr..anniemae.com]
    Sent: Monday, November 01, 2004 1:44 PM
    To: cayenne-use..bjectstyle.org
    Subject: RE: Fetching a NextVal to be used in an insert

    Beth, re-read Andrus' response. I suspect it was dead-on.

    Thanks,

    /dev/mrg

    -----Original Message-----
    From: Williams, Beth [mailto:beth.william..FIB.ORG]
    Sent: Monday, November 01, 2004 2:43 PM
    To: cayenne-use..bjectstyle.org
    Subject: RE: Fetching a NextVal to be used in an insert

    The name of the Oracle sequence is PERSON_ID. The name of the DB
    Attribute name in the modeler is PERSON_ID. The obj Attribute name is
    personId. Is there somewhere in the modeler that you can specify what
    the sequence name is? Looking through the documentation I see a section
    for Generate Primary Key Support. This section refers to the Generate
    Database Schema option where you can specify to "Drop Primary Key
    Support" and "Create Primary Key Support". Does this pertain to what I
    am trying to do? Any additional info you can give to point me in the
    right direction is greatly appeciated. Thanks.

    Beth

    -----Original Message-----
    From: Bryan Lewis [mailto:brya..aine.rr.com]
    Sent: Monday, November 01, 2004 1:29 PM
    To: cayenne-use..bjectstyle.org
    Subject: Re: Fetching a NextVal to be used in an insert

    Williams, Beth wrote:

    > No custom validations on the personId field. Yes, we are using Oracle
    and yes, we do have a sequence (PERSON_ID) set up for the Persons table.

    Is the name of the Oracle sequence the same as the name you set on the
    entity in the modeler? If it wasn't specified, the sequence name
    defaults to PK_TABLENAME, e.g., PK_PERSONS.

    When you're able to do experimentation again, look at the log to see if
    Cayenne is getting as far as the "SELECT pk_persons.nextval FROM DUAL"
    statement. It sounds like the sequence doesn't exist by that name.

    If it does get that far, the next SQL statement will probably be the
    INSERT and you'll be able to see from the bindings what it's using for
    the PERSON_ID.



    This archive was generated by hypermail 2.0.0 : Mon Nov 01 2004 - 14:48:23 EST