You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Thierry Hanot <th...@infovista.com> on 2003/12/15 12:51:27 UTC
Proxy and hashCode method in RC5
Hello All
I use proxies for loading and accessing object by references .
On all the implementation and interface of my objects I have a method
equals and hashCode which allow me to store some of those object in Maps for
retrieve them in an easy way ( which is really fast ) .
The problem with the RC5 is that now in the IndirectionHandler the method
hashCode is not redirected (it was in RC4 ).
As this returned result is not even based on the Identity, I cannot use a
Table with proxies and RealObject ( newly
Created objects for example ) .
I agree with the comment of the new IndirectionHandler ( RC5 ) that the
hashCode should not change even if the
Object is not materialized . But the hashCode should not be the one by
default of all Java Objects but at least one hashCode based on the identity.
B.R
Thierry
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org
Re: Proxy and hashCode method in RC5
Posted by Oleg Nitz <on...@ukr.net>.
Hello Thierry,
This sounds reasonable, I've changed the hashCode as you propose.
Oleg
On Monday 15 December 2003 11:51, Thierry Hanot wrote:
> I use proxies for loading and accessing object by references .
> On all the implementation and interface of my objects I have a method
> equals and hashCode which allow me to store some of those object in Maps
> for retrieve them in an easy way ( which is really fast ) .
> The problem with the RC5 is that now in the IndirectionHandler the method
> hashCode is not redirected (it was in RC4 ).
> As this returned result is not even based on the Identity, I cannot use a
> Table with proxies and RealObject ( newly
> Created objects for example ) .
> I agree with the comment of the new IndirectionHandler ( RC5 ) that the
> hashCode should not change even if the
> Object is not materialized . But the hashCode should not be the one by
> default of all Java Objects but at least one hashCode based on the
> identity.
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org