RE: Add getHashCode() to CayenneDataObject?

From: Gentry, Michael \(Contractor\) ("Gentry,)
Date: Wed Jun 21 2006 - 14:15:29 EDT

  • Next message: Kevin Menard: "Re: Add getHashCode() to CayenneDataObject?"

    Well, perhaps there is a way, but maybe not with Tapestry?

    The..or component can look something like this:

    <span jwcid=..or" source="ognl:lenders" value="ognl:currentLender"
    keyExpression="objectId">

    If you aren't familiar with Tapestry, this means to loop over
    getLenders(). Each iteration over the collection sets the value with
    setCurrentLender(aLender). And the keyExpression becomes
    getCurrentLender().getObjectId(). This works, but it serializes the
    ObjectId for each row to the HTML. When I used "objectId.hashCode" it
    was trying getCurrentLender().getObjectId().getHashCode(), which failed.
    Of course, that would have the problem mentioned earlier (with nulls).

    I added a getHashCode() to my base DO which just wraps hashCode() and it
    seems to be working now (bigger test to follow). I get nice obscure
    keys like "P10930889" stuck in the HTML. (using
    keyExpression="hashCode") Safe and obscure.

    Thanks,

    /dev/mrg

    -----Original Message-----
    From: Kevin Menard [mailto:kmenar..ervprise.com]
    Sent: Wednesday, June 21, 2006 1:17 PM
    To: cayenne-de..ncubator.apache.org
    Subject: Re: Add getHashCode() to CayenneDataObject?

    On Wed, 21 Jun 2006 12:53:58 -0400, Gentry, Michael (Contractor)
    <michael_gentr..anniemae.com> wrote:

    > The System.identityHashCode() would probably work fine, but isn't
    > callable by OGNL. Come to think of it, just being able to call
    > hashCode() from OGNL would be useful, too (and equivialent to
    > System.identityHashCode()).

    Are you sure about this? I've called arbitrary methods from ognl
    before.
    I think your problem is probably one more of order of resolution. I
    don't
    know for certain, but it may try to access bean properties first, then
    method calls, etc.

    -- 
    Kevin
    



    This archive was generated by hypermail 2.0.0 : Wed Jun 21 2006 - 14:15:56 EDT