Hello,
Your query does not look right, especially the join. In HQL, you do not 
need to specify the join condition (no "on" statement), it is generated by 
NHibernate from mappings. If you need additional conditions on the join 
(especially for left join), the correct syntax is to use HQL "with" 
statement.
So if GroupingDefId is your fk/pk relationship your query should look like:
select p.GroupingDefId as GroupingDefId,
    p.TimePeriodRange as Name,
    p.BinLengthLabel as Description
  from TimeToEventGroupingDef as g
  inner join g.TimePeriods as p
  where g.IsHidden = 0
  order by g.SortOrder asc, p.SortOrder asc

If this does not solve your trouble, you should simplify your test case as 
much as possible. (Does the trouble appears without the where condition? 
Without the join (and so with only one sort order)? ...) And the string 
builder looks like unneeded complexity for the test case: the query has 
nothing dynamic, a simple literal should suffice.

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/nhusers.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to