Best practice for bidirectional associations List vs Set

After reading the best parctices section for Hibernate Orm about associations and having a discussion with some of my colleagues, we started to wonder what are the best practices for performances for the different associations given if they are bidirectional?

We found an “old” post regarding Hibernate 4.3 (Hibernate Facts: Favoring bidirectional Set(s) vs List(s)) but don’t know if that applies to later (5+) Hibernate Orm implementations.

I think there is no need to ask for unidirectional since that is written in the user guide already

For unidirectional collections, Sets are the best choice because they generate the most efficient SQL statements. Unidirectional Lists are less efficient than a @ManyToOne associati

Use a List with @OrderColumn if the order is relevant to you. Otherwise, use a Set. It’s as simple as that :wink:

Well that is good to know know :slight_smile: then we don’t need to do any changes to our collection mappings.