Re: Add getHashCode() to CayenneDataObject?

From: Kevin Menard (kmenar..ervprise.com)
Date: Wed Jun 21 2006 - 14:34:52 EDT

  • Next message: Gentry, Michael \(Contractor\): "RE: Add getHashCode() to CayenneDataObject?"

    On Wed, 21 Jun 2006 14:15:29 -0400, Gentry, Michael (Contractor)
    <michael_gentr..anniemae.com> wrote:

    > The..or component can look something like this:
    >
    > <span jwcid=..or" source="ognl:lenders" value="ognl:currentLender"
    > keyExpression="objectId">

    I'm not familiar with keyExpression, but I think the handling of ognl is
    uniform throughout Tapestry.

    > 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).

    Well, I have some example method calls here. I know the first one will
    make you cringe, but I'm not concerned with the PK being exposed in this
    case (read-only entries):

    <a href="#" jwcid=..roductLink"
    parameters="ognl..rg.objectstyle.cayenne.DataObjectUtils@intPKForObject(product)">

    and:

    <img alt="product image" jwcid="productImag..mage"
    image="ognl:product.getStoreImage(servletContext, webRequest,
    requestCycle)"/>

    Note the method arguments are exposed page properties.

    So, I see no real reason that you can't call whatever method you'd like.
    Off the cuff, it would seem that "objectId.hashCode()" would work.

    -- 
    Kevin
    



    This archive was generated by hypermail 2.0.0 : Wed Jun 21 2006 - 14:35:16 EDT