In hibernate manual it is said that you have to override the equals() and hashCode() methods if you intend to put instances of persistent classes in a Set (the recommended way to represent many-valued associations).
So the questions appeared:
Why is it a recommended way to represent many-value associations in a set?(Why shouldn't I use, let's say, ArrayList or LinkedList).
What happens behind the scene that I should override those methods only when I use Set?