There are following difference between Set and Bag in Hibernate.We are do mapping inside hbm file.
Bag :-
A Bag in Hibernate is an unordered collection. It can have duplicate elements. When we persist an object in a bag, there is no guarantee that bag will maintain any order.
There is not a “bag” concept in Java collections framework, so we just use a java.util.List corresponds to a <bag>.
Set :-
A Set in Hibernate can only store unique objects. If we add the same element to set second time, it just replaces the old one. By default a Set is unordered collection in Hibernate.
A set is unordered by default but we can ask it to be sorted. The corresponding type of a in Java is java.util.Set.