title: Hibernate Lazy using Initilize or EAGER loading
body: <p>I have three tables, </p>
  
  <pre><code>users
  user_associations
  association_type.
  </code></pre>
  
  <p>Users are associated to each other through the users_associations table and then the association is given a type such as PARENT, or FRIEND, etc..</p>
  
  <p>When I call my view I have the table data for user's associations to each other. Within each list there is a relationship to the current users data, the associated users data, and the list of association types.</p>
  
  <p>I am using Hibernate and I am confused between EAGER fetching the data and LAZY loading it. When I call my DAO it looks like this</p>
  
  <pre><code>List&lt;UsersAssoc&gt; assoc = (List&lt;UsersAssoc&gt;)session.getNamedQuery("UsersAssoc.getAssoc").setInteger("id", id).list();
  </code></pre>
  
  <p>To get LAZY loading to work I have to call Hibernate.initialize on all of the sub objects </p>
  
  <pre><code>    for(UserAssoc a : assoc ) {
             Hibernate.initialize(a.getUser() );
             Hibernate.initialize(a.getAssocTypes() );
             Hibernate.initialize(a.getAssociatedUser() );
      }
  </code></pre>
  
  <p>I need to refer to all of the data in my view and I am trying to do it without storing all of it in memory. Which option is the best? Eagerly load it or Initialize each type within Hibernate. This might not even be the right way of doing it. I need some direction. Thanks</p>