Description of problem: Most of our persistent classes (i.e., classes managed by Hibernate) do not implement equals() and hashCode(). These methods are critical for entity types as well as as any class in which instances are stored in a Collection. Documentation on this can be found in the Hibernate reference manual at http://www.hibernate.org/hib_docs/reference/en/html/persistent-classes.html. This article on the Hibernate site, http://www.hibernate.org/109.html also provides some good information. This has already resulted in production bugs and really should be addressed sooner rather than later. Implementing and testing equals() and hashCode() can be difficult. I have implemented some test libraries to aide in testing. The class ObjectTestUtils greatly simplifies the verification effort involved. This class is part of the jbossnetwork project and resides in the test-utils module. I have also implemented methods to facilitate implementing equals() and hashCode(), CustomEqualsBuilder and HashCodeBuilderFactory in particular. These classes handle some MySQL date issues. See Users.java for an example. It is in the jbossnetwork project in the issuetracker module. Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info:
*** Bug 454733 has been marked as a duplicate of this bug. ***
*** Bug 453182 has been marked as a duplicate of this bug. ***
Superceded by Avalon. This component is no longer valid.