title: Hibernate Mapping One-to-Many, weird example
body: <p>We are trying to build a One-to-many relation. Trying to understand how this works, we stumbled across <a href="http://www.vaannila.com/hibernate/hibernate-example/hibernate-mapping-one-to-many-using-annotations-1.html" rel="nofollow">this example</a>, which shows how to do it.</p>
  
  <p>The example shows a reasonable ER diagram, but generally speaking in a One-to-many relation one doesn't need an auxiliary table. We could insert a <code>StudentId</code> column into the <code>Phone</code> table and achieve the linking by joining the two tables through this identifier. In the example, by contrast, they need to join three tables instead.</p>
  
  <p>We are wondering if such a behaviour is justified by some good practice which makes the management easy for Hibernate or if it's just an error of the guy who wrote the article.</p>
  
  <p>Any thoughts?</p>