Table2.SomeOtherField = 'Some value'  is the mapped filter there.
This would be a query against Table1 with an active filter applied to
Table2.

Are you saying that this change is by design?

On Aug 3, 3:47 pm, Fabio Maulo <[email protected]> wrote:
> which is the mapping ?This is one of possible breaking change
> (releasenotes.txt)
> * Now filters are working even with many-to-one association for Criteria and
> HQL (NH-1293, NH-1179)
>
> 2009/8/3 Ryan Scott <[email protected]>
>
>
>
>
>
> > I'm not sure whether this is a bug or a "feature".  If it is a bug,
> > I'll add this as a JIRA entry instead.  It certainly seems like a bug
> > to me.
>
> > At some point between January and May of this year, the behavior of
> > filter parameters changed when used with joins.  This only really a
> > problem for outer joins.
>
> > Filters used to produce SQL similar to the following:
>
> > SELECT <fields>
> > FROM Table1
> > LEFT JOIN Table2
> > ON Table1.id = Table2.id
> > AND Table2.SomeOtherField = 'Some value'
>
> > The key there is that the filter t2.SomeOtherField = 'Some value' is
> > appended to the ON clause of the LEFT JOIN.  This allows rows from
> > Table1 to be returned even if no matching rows from Table2 exist.
> > After some change, the SQL now looks like this:
>
> > SELECT <fields>
> > FROM Table1
> > LEFT JOIN Table2
> > ON Table1.id = Table2.id
> > WHERE Table2.SomeOtherField = 'Some value'
>
> > This renders the LEFT JOIN useless, because the filter criteria is now
> > applied to the overall where clause.  It seems the filter should only
> > by applied to selects from Table2.
>
> > FYI I'm using .NET 3.5, Sql 2005 dialect
>
> --
> Fabio Maulo
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to