title: Eager Loading usig Batch Fetching
body: <p>Is it possible to coerce JPA implemented by Hibernate into doing eager loading using Batch fetching?</p>
  
  <p>You are probably wondering why I want to do such a strange thing, so let me explain. </p>
  
  <p>We have two Entities <code>A</code> and <code>B</code>. There is a many to 1 relationship from <code>A</code> to <code>B</code>.</p>
  
  <p>I want to load <code>A</code> entities with a search, and I want to have them fully loaded before they get returned from the repository.</p>
  
  <p>But since there are lots of <code>A</code>'s and very few <code>B</code>'s all the (relevant) <code>B</code>'s will be in the second level cache. Therefore I want to avoid getting all the <code>B</code>'s every time from the database.</p>