Struts 2 ServletActionContext class Tutorial

Lazy collection loads the child objects on intehibernate , it is utilized to improve execution. Since Hibernate 3.0, lazy collection is empowered by default.

To utilize sluggish gathering, you may alternatively utilize lazy="true" characteristic in your collection . It is as a matter of course obvious, so you don't have to do this. In the event that you set it to false, all the child items will be stacked at first which will diminish execution if there should be an occurrence of huge data.

Let's see the hibernate mapping document where we have utilized lazy="true" attribute.

  1. <list name="answers" lazy="true">  
  2.           <key column="qid"></key>  
  3.           <index column="type"></index>  
  4.           <one-to-many class="com.javacodegeeks.Answer"/>  
  5. </list>  

javacodegeeks is optimized for learning.© javacodegeeks .
All Right Reserved and you agree to have read and accepted our term and condition