title: Lazy-loading with Spring HibernateDaoSupport?
body: <p>Greetings I am developing a non-webapplication using Spring+Hibernate.
  My question is how the HibernateDaoSupport handles lazy-loading , because after a call do DAO , the Session is closed.</p>
  
  <p>Take a look at following psuedo-code:</p>
  
  <p>DAO is like:</p>
  
  <pre><code>CommonDao extends HibernateDaoSupport{
   Family getFamilyById(String id);
   SubFamily getSubFamily(String familyid,String subfamilyid);
  }
  </code></pre>
  
  <p>Domain model is like:</p>
  
  <pre><code>Family{
   private List&lt;SubFamily&gt; subfamiles;
   public List&lt;SubFamily&gt; getSubFamiles();
  }
  
  SubFamily{
   private Family family; 
   public Family getFamily();
  }
  </code></pre>
  
  <p>In the application I get DAO from app-context and want to following operations.Is this possible to do with lazy-loading because AFAIK after every method (getFamilyById() , getSubFamily() ) the session is closed.</p>
  
  <pre><code>CommonDAO dao=//get bean from application context;
  Family famA=dao.getFamilyById(familyid);
  //
  //Do some stuff
  List&lt;SubFamily&gt; childrenA=fam.getSubFamiles();
  
  SubFamily asubfamily=dao.getSubFamily(id,subfamilyid);
  //
  //Do some other stuff
  Family famB=asubfamily.getFamily();
  </code></pre>