[jboss-dev-forums] [Design of JBoss jBPM] - Re: various questions

tom.baeyens@jboss.com do-not-reply at jboss.com
Tue Feb 27 09:55:38 EST 2007


"gavin.king at jboss.com" wrote : The problem is nothing to do with proxies. AFAIR, there is no problem using foo.equals(bar) with a default implementation of equals. (Even if foo and bar are proxies.)
  | 
  | The problem is that == is an incorrect implementation of equals, since two nonidentical objects with represent the same data (ie, the same row of the database) will not be equal. This is nothing to do with Hibernate.
  | 
  | "business key" equality is the correct interpretation of equals() from a data modelling perspective. It represents what the *user* thinks of as the "same objects".

there is no problem with proxy1.equals(proxy2).

the problem appears when proxy1 is compared with its underlying real object.  this happens when using proxies obtained from hibernate with the usage of 'this' (e.g. by passing 'this' as a parameter in another method)


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4023070#4023070

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4023070



More information about the jboss-dev-forums mailing list