Taken from here: http://docs.jboss.org/hibernate/stable/core/reference/en/html/persistent-classes.html#persistent-classes-equalshashcode
I tend to use List
since Criteria
returns List
, so it makes my code cleaner since I don't have to do conversion.
I do something like so..
@OneToMany(cascade= {CascadeType.PERSIST, CascadeType.REMOVE}, mappedBy="parent")
@Column(name="PARENT_ID")
public List<Menu> getChildMenus() {
return childMenus;
}
If I had use Set
there, somewhere in my DAO I will have to convert results returned by Criteria
to Set
first.
I wonder what the repercussion could be by using List
they way I am doing.