java - Do I need to override hashCode when using a Set with a Hibernate many-to-many relationship? -
if have many-to-many relationship hibernate, , both sides store collection in set, , set initialized hashset, need override hashcode types stored in set?
my gut says no, since hibernate replace initial hashset own set. sometimes/always/never correct?
i think should override hashcode()
, equals()
cause it's set , , don't break contract. sortedset
use comparable instead . overriding equals , hashcode in hibernate
Comments
Post a Comment