Re: Primary Keys in Cayenne

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Wed Dec 04 2002 - 13:06:00 EST

  • Next message: Dave Slusher: "Re: Primary Keys in Cayenne"

    Dave Slusher writes:
    >
    > <obj-attribute name="id" type="java.lang.Integer" db-attribute-name="id"/>
    >
    > This is what you were saying, right? If there exists an ObjAttribute
    > mapped to the DbAttribute, it shouldn't generate the support. However,
    > after adding in that line I'm not seeing an effect. I get the identical
    > SQL out of it before and after adding that line. Is there more I need to
    > do in the data map to suppress this?

    Hmm, yes. This is what I meant. I guess you will also need to make "id" your
    class property and explicitly assign a value to the Java object before
    commit:

     obj.setId(12345);

    Let me know if this works. We should create a bug if it doesn't.

    This kind of reminds me that we don't have tests for this case. I will add
    them soon just to be sure that it works as advertised.

    > Thanks for the help. Cayenne really rocks, shortening an odious cross-db
    > support issue we have by days if not weeks. Kick ass!

    Cool! I didn't know Guarded used Java, I thought you guys were a C(++) shop.

    Andrus



    This archive was generated by hypermail 2.0.0 : Wed Dec 04 2002 - 13:06:04 EST