Re: [JIRA] Created: (CAY-835) setting meaningful pk to zero turn on autogenerated keys

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Mon Jul 30 2007 - 05:07:00 EDT

  • Next message: Andrus Adamchik (JIRA): "[JIRA] Created: (CAY-836) EJBQL Delete Statement Support"

    > I now found a similar problem, but I do not know if it is the same.
    > Having a CHAR(2) as the meaningful primary key (yes, it is a bad
    > idea...) makes cayenne (after upgrading to 3.0M1) throw away the
    > value I set and create its own numeric value. As "200" and "201"
    > does not fit in a CHAR(2) the database throws a SQLException.

    What PK-generation strategy is selected for this entity? "Default" or
    "Database-generated"?

    > Do you think it is the same issue or should I register it?

    I don't know... This may be a different kind of issue. Essentially
    Cayenne can not generate CHAR pks by definition, and probably should
    not attempt to. And afaik it won't if the strategy is "Default". Not
    sure what we should do if the user selects "Database-generated" in
    this case - probably show a validation warning in the Modeler?

    Andrus

    On Jul 30, 2007, at 11:19 AM, Tore Halset wrote:

    > On Jul 30, 2007, at 9:44 , Andrus Adamchik wrote:
    >
    >> Hi Tore,
    >>
    >> I suspect that this is a duplicate of CAY-811:
    >>
    >> https://issues.apache.org/cayenne/browse/CAY-811
    >>
    >> Essentially any user provided value (not just zero) of a
    >> meaningful PK is ignored if the PK is configured as DB-generated.
    >>
    >> Andrus
    >
    > Okay, thanks. I closed 835 and commented on 811.
    >
    > I now found a similar problem, but I do not know if it is the same.
    > Having a CHAR(2) as the meaningful primary key (yes, it is a bad
    > idea...) makes cayenne (after upgrading to 3.0M1) throw away the
    > value I set and create its own numeric value. As "200" and "201"
    > does not fit in a CHAR(2) the database throws a SQLException.
    >
    > Do you think it is the same issue or should I register it?
    >
    > Regards,
    > - Tore.
    >



    This archive was generated by hypermail 2.0.0 : Mon Jul 30 2007 - 05:07:25 EDT