Don't Let Hibernate Steal Your Identity (5 tags)
Hibernate has one set of ideas about how to make something unique, such as using a database sequence number as an ID. But this clashes with Java's need for implementations of
hashCode() that determine identity for objects, even those that haven't yet made a trip to the database and thus can't have a sequence number. James Brundege has an option that should satisfy both Hibernate and Java.