Thread:
 Our approach: Don't bother 
 rhasselbaum   18 Jul 2005, 16:06 

Comment
Prev. thread 
 Next thread
 
Prev. posting 
 Next posting
From: rhasselbaum (18 Jul 2005, 16:06) Replies: 0, Views: 39292
Subject: Our approach: Don't bother
We made a conscious decision NOT to override the default 
implementations of equals and hashCode, and rely exclusively on object 
identity. There are the known limitations, of course, but they haven't 
been much of a problem in practice. We rarely have a need to "mix" two 
objects with the same database identity loaded from two different 
sessions. And when we do, we create an inner class that encapsulates 
the business key from the entity and use that as the key into maps and 
such.

It may not address all cases perfectly, but it's consistent and easy 
to follow.
Prev. thread 
 Next thread
 
Prev. posting 
 Next posting
© Copyright 2006, Red Hat Middleware, LLC. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc. [Privacy Policy]