Sunday, March 22, 2015

Hibernate lazy fetch true/false



lazy=false means hibernate will load the objects entities all at once. 

Means it  loads parent records and child records as well in single query. 



lazy=true means hibernate will load the objects whenever they are needed, i.e. any particular entity object will be loaded when that entity object is referenced from your application.


Means it loads only parent records (primary key records) only and its recommended for memory optimizations

No comments:

Post a Comment