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

Popular posts from this blog

jasper reports - Fixed header in Excel using JasperReports -

media player - Android: mediaplayer went away with unhandled events -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -