Would it make sense to add:

public int getHashCode()
{
  return getObjectId().hashCode();
}

To CayenneDataObject.java?  The primary reason is to better support
Tapestry.  In T4, the @For component can take a keyExpression (which is
parsed by OGNL) which should return the primary key, which gets placed
in the HTML page (this is used due to stale link exceptions).  I don't
want to expose primary keys in the HTML, though, and using
"objectId.hashCode" doesn't work as an OGNL expression since hashCode()
!= getHashCode().  If the above method were added, "hashCode" would work
as the expression.

Any thoughts on this?  Or is there another way to get a unique value for
an object that doesn't expose the entity/keys?  If only Java let me get
the pointer (I miss &).

Thanks,

/dev/mrg

Reply via email to