I have two tables which are linked by a joint table:

Staff (one) <-- (many) StaffRights 

StaffRights (many) --> (One) Rights

    Table1 --> Staff
    StaffID: PK
    Name

    Table2 --> StaffRights
    SRID: PK
    StaffID:FK
    RightID:FK
    CreatedTS

    Table3 -->Rights
    RightID: PK
    RightName

And I want to select columns from all the tables doing something like this:


    Select s.Name, s.StaffID, sr.RightID, r.RightSelectName 
    From Staff s 
    INNER JOIN StaffRights sr ON s.StaffID = sr.StaffID 
    INNER JOIN Rights r ON sr.RightID = r.RightID 
    Where sr.DeletedTS IS NULL AND s.DeletedTS IS NULL AND s.IsSelfservice 
= 0 s.Name = 
    'myquery1' AND s.Pwd = 'myquery2'

This link claim that it can only be done via HDL 
[http://www.independent-software.com/nhibernate-fast-loading-of-data-from-multiple-tables-into-a-tree-structure.html][1]
 
Can't I do via query api, I have tried joinalias, Inner.JoinQueryOver, none 
of them work so far.


  [1]: 
http://www.independent-software.com/nhibernate-fast-loading-of-data-from-multiple-tables-into-a-tree-structure.html

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nhusers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nhusers/69a7aa4c-2faa-4377-8fb7-bed776f788a1%40googlegroups.com.

Reply via email to