Re: Validation failures with Primary Key

From: Bryan Lewis (brya..aine.rr.com)
Date: Mon May 16 2005 - 09:28:43 EDT

  • Next message: Andrus Adamchik: "Re: Validation failures with Primary Key"

    Maybe this is what's happening... If you're exposing the primary key as an
    object attribute, you're taking the responsibility for setting it when a new
    object is created. "Cayenne will not attempt to generate a primary key on
    INSERT unless the field is empty, therefore you can explicitly set a primary
    key value." If you do not set a value, you will get the "id is required"
    error message.

    ----- Original Message -----
    From: "Doychi" <doychi-list..oychi-dina.ath.cx>
    To: <cayenne-use..bjectstyle.org>
    Sent: Monday, May 16, 2005 5:42 AM
    Subject: Validation failures with Primary Key

    > Hi all,
    >
    > I'm currently working on a project that is exposing the primary key of a
    > Product using the instructions from the wiki
    (http://objectstyle.org/confluence/display/CAY/Mapping+Primary+Keys). I
    keep getting this message when attempting to create a new product.
    >
    >
    > Validation failure for au.com.relevance.corporatedb.Product.id: "id" is
    > required.
    >
    >
    > I have tried both creating the object and then registering it and having
    > the context create and register the object. The result is the same.
    >
    > Is there something I'm missing.
    >
    > --
    > Doychi
    > spdoychia..oychi-dina.ath.cx
    >



    This archive was generated by hypermail 2.0.0 : Mon May 16 2005 - 09:29:16 EDT