On my current project I implemented static helper methods for generating equals() and hashCode() on any entity. We didn't do the bytecode generation, so for each entity we had to implement the methods to call the appropriate static helper method, but it still took a lot of the potential errors (and tedium) out of implementing those methods (and it did work and wasn't magical, unlike bytecode generation). Even if Hibernate doesn't do the bytecode generation, it should at least implement similar helper methods so users can call them easily when defining each entity type...
|