title: Lazy vs Eager loading with JPA
body: <p>I am trying to get some JPA stuff to work.  I have a table that has foreign keys to another tables.  When I generate the JPA entities I get one to many anotations over those variables... what else would I need to do get all the tables back in the result set?  if I indeed call it.  Here is an example of what I am trying to do.</p>
  
  <pre><code>@OneToMany(mappedBy="resourceId")
  private List&lt;DistributionLink&gt; distributionLinkCollection;
  </code></pre>
  
  <p>@OneToMany annotation is sitting pretty...</p>
  
  <p>I am thinking to get all values back I would need to just call the named query that calls for this table right?</p>
  
  <pre><code>qLaunchArr = (QuickLaunch[])emf.createNamedQuery("QuickLaunch.getQuickLaunch").getResultList().toArray();
  </code></pre>
  
  <p>Am I way off base to think that I will also get an array of DistributionLinks with all result sets?
  Now I know this has something to do with Eager Loading vs Lazy loading.  Exactly what, I am not sure.  I know lazy loading only loads @oneToMany attributes explicitly called (I think)?  How can I get back all those collections I will need.  Will I need to loop through the result set and also call a named query to get all result sets using a named query?</p>
  
  <p>Thanks.</p>