Lazy Loading is as opposed to Eager Loading.
When lazy loading is set to true (i.e. lazy="true" in the mapping file), Hibernate will not load related objects (e.g. via foreign key association) when the object is loaded. When lazy="false", all related associations will be loaded.
In addition, the "fetch" attribute in the mapping file also influences how these associations are fetched. With "join", they are fetched with an OUTER JOIN query and works best in an eager loading scenario. With "select", they are fetched with separate statements and works best in a lazy loading scenario but can result in more queries depending on usage pattern.
References:
No comments:
Post a Comment