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

html - Cut text on left side inside button while centering -

plugins - CodeIgniter support on netbeans 8.0 -

php - Selecting items from MySQL for a status update feed efficiently while accounting for possible spam -