Eager load property of an element in a map collection

20 views
Skip to first unread message

Michael Charalambous

unread,
May 28, 2012, 4:37:57 AM5/28/12
to nhu...@googlegroups.com
Hi

Is it possible to ask NHibernate to eager load a property of an element held within a map collection? I have done a fair bit of googling and tried a few different variations with no success.

My current attempt in HQL is below, the third line, where I try to fetch "responsibilities", is the issue.

select c from Company c
left join c.employees e
left join element(e).responsibilities r
where c.id = :id

Any advice would be appreciated.

Thanks
Michael

Michael Charalambous

unread,
May 28, 2012, 9:34:32 AM5/28/12
to nhu...@googlegroups.com
Sorry my HQL sample was wrong, I missed the fetch bit out of the join, it should have said


select c from Company c
left join fetch c.employees e
left join fetch element(e).responsibilities r
where c.id = :id

Michael
Reply all
Reply to author
Forward
0 new messages