title: How to create Hibernate Mapping for a self referencing table
body: <p>I was asked how I would create a hibernate mapping for a column in a table that refers to the primary key of the table. </p>
  
  <p>For example, an Employee table has EMP_ID as primary key and it also has MGR_ID column to know the manager of the employee. As a manager is also an Employee, it would be in the same table. Hence every Employee row has a manager Id which is also an employee. </p>
  
  <ol>
  <li>How do we create Hibernate Mapping for this Employee Class? </li>
  <li>How would the Employee class look like? Does it have just a manager Id in it or it will contain another Employee Object as a member variable. </li>
  </ol>
  
  <p>Kindly help me with this kind of scenario. Thank you.</p>