Lazy Loading / Eager fetching in Hibernate -
i have set property lazy="false" in hbm file column contact in table "employee"
the below query executed retrieve employee id 5:
select e employee e e.id = 5
on execution, number of queries being executed , guess due non lazy loading.
how make sure 1 query executed? can change query keeping property lazy false? if not, should change in query retrieve record?
i'm using spring+hibernate
based on query, i'm going assume you're using hql this. i'm going assume contact
reference.
select e employee e left join fetch e.contact e.id = 5
Comments
Post a Comment