title: Hibernate join fetch
body: <p>I have implemented the following example  in this blog  <a href="https://www.tutorialandexample.com/hibernate-n-1-select-problem/" rel="nofollow noreferrer">https://www.tutorialandexample.com/hibernate-n-1-select-problem/</a>  but I am not happy with the output that I am getting. I am displaying the output which shows Department details and Employee details printed as twice . I want to get the Department details and Employee details to be displayed only once . Any Suggestions ?</p>
  
  <p>The size of depart List object is 4 but actually it must be 2 .</p>
  
  <p>output :</p>
  
  <pre><code>Department details:::::
  20  IT
  Employees details::::::
  21  jyotika
  22  shubham
  Department details:::::
  20  IT
  Employees details::::::
  21  jyotika
  22  shubham
  Department details:::::
  23  Accounts
  Employees details::::::
  24  nihal
  25  neha
  Department details:::::
  23  Accounts
  Employees details::::::
  24  nihal
  25  neha
  </code></pre>