I agree that a workaround should not be needed. I think that the criteria for the filter in the outer joined entity should be put in the from clause instead of the where clause.
On Sep 29, 5:54 pm, Gunnar Liljas <[email protected]> wrote: > Defining the filter as "tenantId=:tenantId or tenantId is null" is a > workaround. Any "join checking" queries will use the primary key of the > joined table anyway, so there should be no side effects. > > I suggest a JIRA search/submission anyway, since such a workaround should > not be needed. > > /G > > 2011/9/29 Matt Mangold <[email protected]> > > > > > > > > > In my application, I have defined a global filter on Tenant Id. I do > > this to enforce tenant security, so that developers do not > > accidentally create queries that allow information to cross tenant > > boundaries. > > > The problem I am having is that when I create queries that eagerly > > fetch associations, the queries produce sql that uses left outer > > joins, and the tenant filter is being applied to the entities in the > > left outer join in the where clause. This essentially acts like an > > inner join, and I end up losing records. > > > Has anyone experienced this same problem with NHibernate filters. Is > > there a way to work around this so that I can still enforce this type > > of security and still keep my outer joins in tact? > > > Just to clarify, this is an example of a filter: > >http://ayende.com/blog/3993/nhibernate-filters > > > Your help is greatly appreciated. > > > -- > > 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. -- 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.
