[SOLVED] 1.0rc2 - INSERT not activating Oracle Sequences for primary key generation, NULL instead.

From: Mike Kienenberger (mkienen..laska.net)
Date: Wed Sep 10 2003 - 11:32:30 EDT

  • Next message: Mike Kienenberger: "ORACLE sequence numbers not incrementing...."

    Mike Kienenberger <mkienen..laska.net> wrote:
    > I'm seeing my primary key set to NULL when I try to commitChanges a new
    LOG
    > object.

    This was a case of user error. I had read that primary key generation
    worked differently in Cayenne than in EOF, but I didn't notice a conflict in
    my model.

    I had an object (class) attribute defined for my logging table's primary
    key, which as documented, causes automatic primary key generation to be
    ignored.

    I'm not entirely convinced that this is a good design since there are cases
    where you need to automatically generate "meaningful" (once they're
    generated) primary keys.

    For example, invoice numbers. I suppose it could be done with some
    database-specific SQL or stored procedure, but that defeats the purpose of a
    database layer product.

    -Mike



    This archive was generated by hypermail 2.0.0 : Wed Sep 10 2003 - 11:29:38 EDT