RE: PK in Expression ok?

From: Cris Daniluk (cris.danilu..laraview.com)
Date: Thu Mar 24 2005 - 09:45:49 EST

  • Next message: Andrus Adamchik: "Re: retrive data from Multiple tables using SqlTemplate"

    > From what I understand, it might be a good idea to define a
    > method to retrieve the PK in the lower level generated class
    > (which is normally empty).
    > It's explained on the
    > http://www.objectstyle.org/cayenne/userguide/dataobjects/unmap
    > ped-keys.html
    > page.
    > When you have access to your PK, you can use it in
    > expressions like any other attribute.

    This isn't quite right. Adding PK references to the wrapper class will not
    make a difference on what you can and cannot do in expressions. On the other
    hand, he already has the pk according to his example. I think what you're
    referring to is adding the pk to the ObjEntity in the modeler.

    > I'm curious, though: why in the world would you need to
    > include two criteria, when one of them uniquely identifies a record?
    >
    If you look at his example, the first criteria was an attribute on the
    object, while the second was a pk on a related object - not the same object
    (toBudget)

    Cris



    This archive was generated by hypermail 2.0.0 : Thu Mar 24 2005 - 09:45:45 EST