Super agree (have a look to HQL behavior ;) ) On Thu, Jul 8, 2010 at 6:24 AM, Steve Strong <srstr...@gmail.com> wrote:
> I've been pondering this thread over on nh-users > http://groups.google.com/group/nhusers/browse_thread/thread/1ff37a36e9f975ce?hl=en# > > To save you reading it all, the guy is try to do this: > > Session.Query<Project>().OrderBy(p.Type.Label).ToList() > > but due to the reference to p.Type there is a join being inserted, which > means that there is some un-intentional filtering going on (he doesn't > receive any results where p.Type is null). > > This is analogous to hitting a child reference within a select, for example > > Session.Query<Project>().Select(p.Type.Label).ToList() > > In this case, the provider (correctly, imo) generates outer joins to ensure > that filtering is not taking place. In my view, filtering of the results > should only happen if there is an explicit join or where clause. > > So I'm proposing that I process OrderBy clauses in the same way as I handle > Select, and introduce outer joins as appropriate - this is technically a > breaking change, hence the post here to see if you all agree. > > Cheers, > > Steve > -- Fabio Maulo