NHibernate QueryOver syntax with multiple tables

Refresh

2 weeks ago

Views

3 time

0

I have some problems with NHibernate QueryOver Syntax. I am not able to convert the following SQL to NHibernate QueryOver Statement:

"select m.* " + 
                       "from authmodule m inner join authmoduleassignment ma on m.Id = ma.module_id " +
                       "inner join authroleassignment ra on ma.role_id = ra.role_id " +
                       "inner join authgroupassignment ga on ra.group_id = ga.group_id " +
                       "inner join employee emp on ga.employee_id = emp.Id " +
                       "where emp.employeenumber = :empNo"

I have the same query as HQL too:

"select m " +
                "from ModuleAssignment ma " +
                "inner join ma.Module as m " +
                "inner join ma.Role r, " +
                "RoleAssignment ra " +
                "inner join ra.Group g, " +
                "GroupAssignment ga " +
                "inner join ga.Employee emp " +
                "where emp.EmployeeNumber = :empNo " +
                " and ra.Role = r and ga.Group = g";

Can someone help me in this case? Thanks in advance and kind regards

0 answers