title: Hibernate: best collection type to use - bag, idbag, set, list, map
body: <p>I am looking for what most people use as their collection type when making one-to-many associations in Hibernate. The legacy application I am maintaining uses bags exclusively, but keeps them as lists in code. The tables associated have an id field, so an idbag seems more appropriate, but documentation recommends a Set. </p>
  
  <p>EDIT: I mistakenly referenced that the documentation recommends a set. In reality, the official documentation is equally vague on all collection types. What I find is that <a href="https://forum.hibernate.org/viewtopic.php?p=2390190" rel="noreferrer">some</a> <a href="http://ndpsoftware.com/HibernateMappingCheatSheet.html" rel="noreferrer">websites</a> seem to infer that Set is the most common, and the Hibernate book I am reading explicitly says this about sets:</p>
  
  <blockquote>
    <p>This is the most common persistent collection in a typical Hibernate application. (see: page 242 of 'Java Persistence with Hibernate' by Christian Bauer and Gavin King) </p>
  </blockquote>
  
  <p>I guess that is what threw me and made me seek out what others are using.</p>
  
  <p>EDIT2: note that Gavin King is the creator of Hibernate</p>