Re[2]: Working with ObjectIds

From: Kevin J. Menard, Jr. (nirvdru..egativetwenty.net)
Date: Wed Sep 08 2004 - 11:25:59 EDT

  • Next message: Gentry, Michael: "RE: CM Recent Files List?"

    Hello Michael,

    Wednesday, September 8, 2004, 10:58:14 AM, you wrote:

    GM> You can certainly pass your primary key around in the URL, but keep in
    GM> mind this opens the application up to spoofing (which, depending on the
    GM> nature of your application, could be a very bad thing).

    Yeah, this is just used to pull out a bookmark. The worst that could happen is the wrong bookmark is pulled, or a null object results.

    Hopefully I'm not teetering too much on a more Tapestry related question, but what are other (read: better) approaches for doing this?

    GM> You can use the new
    GM> DataObjectUtils (assuming you have a recent release of Cayenne) to fetch
    GM> the object based upon the primary key:

    GM> http://www.objectstyle.org/cayenne/api/cayenne/org/objectstyle/cayenne/DataObjectUtils.html

    This worked great. Thanks a lot. Originally I was just trying to pass the data object itself, but apparently it's not Serializable, so the only thing I was getting of any value in my listener method was the object id anyway. But if Cayenne's caching, passing the whole object was probably a waste anyway.

    -- 
    Kevin
    



    This archive was generated by hypermail 2.0.0 : Wed Sep 08 2004 - 11:26:27 EDT