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

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -