Someone correct me if I'm wrong, but thats generally not possible with
Criteria or QueryOver, unless you use predefined Filters in the mapping and
activate the filter before the query, so HQL or LINQ tends to handle these
cases a bit more smoothly.

-Francois

On Tue, Mar 22, 2011 at 4:52 AM, Michael Watkin <[email protected]> wrote:

> Hello,
>
> I have a query using that specifies the with clause criteria on a left
> outer join. I can do that with the ICriteria API like so:
>
> return Session.CreateCriteria<A>()
>    .Add(Restrictions.Eq("Name", name))
>    .Add(Restrictions.IsNull("EffectiveToDate"))
>    .CreateCriteria("FamilyMembers", "pfm", JoinType.LeftOuterJoin,
> Restrictions.IsNull("pfm.EffectiveToDate"))
>    .UniqueResult<A>();
>
> However, I can't seem to find a way to do it with QueryOver(). Is
> there any support in the QueryOver API for specifying the with clause
> on a left outer join? Or is there a better way to write the query? I'm
> using NHibernate 3.0.
>
> Thanks,
> Michael.
>
> --
> 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.

Reply via email to