Recommended method of using/getting to PK IDs

From: Merritt, Scott (Scott.Merrit..amu.net)
Date: Tue May 27 2003 - 15:53:00 EDT

  • Next message: Holger Hoffstätte: "Re: Recommended method of using/getting to PK IDs"

    I stepped away from my work for a bit and then got back to things with
    the new beta 3 release. Everything appears to work great so far. I do
    have a question about PKs though.

    What is the recommended way to access a fetched object's primary key? I
    thought the easiest way would be to just create an attribute and map it
    to the column in the table, but that broke the autogen of the IDs for my
    objects. I started poking around and found a getObjectId() method off
    fetched objects that sounded like it would do the trick. From that, I
    get the ObjectId object that I can call getIdSnapShot() which apparently
    returns a Map of all the PK attributes. Does it sound like this is the
    way I should be going about it, or would it be better to go down a
    different path?

    I'm building a web app and want to pass around the IDs in URLs so I can
    easily reference records and when the user bookmarks the page, they get
    a bookmark to that record to come back to later.

    Thanks,
    -smerritt



    This archive was generated by hypermail 2.0.0 : Tue May 27 2003 - 15:53:22 EDT