Is it possible to convert this SQL to HQL?
I have tried but I am having difficulty with the nested join syntax.
select
emp.FirstName,
nestedEmp.Hours
from Employee emp
join
(select
e.Id,
w.WorkTimeType,
Hours = SUM(hours)
from Employee e
left join WorkTimeEntry w on e.Id = w.EmployeeId
group by e.Id, w.WorkTimeType) as nestedEmp
on emp.Id = nestedEmp.Id
The documentation says:
So, this is not possible to translate it directly to HQL. (Note: I checked for Hibernate, but it must be the same in NHibernate).