Forum

Number Of Page View:100,000+/Months
LOGIN |New User

Reply

what is lazy initialisation in hibernate?
Hibernate supports the feature of lazy initilasation for both entities and collections. What this actually means is, the Hibernate engine loads only those objects that we are querying for and doesnt try to fetch other entities(that are associated with the entity we are querying) or collections.
Hibernate loads collection elements only when actually you ask for them by saying lazy=true or lazy=false.
Example:
<set name="Child" lazy="false" inverse="true">
  <key column="COL"/>
  <one-to-many class="Parent"/>
</set>
Posted By: Name:Rajesh Kr URL: what is lazy initialisation in hibernate?