Try it:
return Session
.QueryOver<Movie>() <-- I want distinct Movies
.Inner.JoinQueryOver<Actor>(a => a.ActorList)
.Where(a => a.Name.IsLike("m%"))
.TransformUsing(Transformers.DistinctRootEntity)
.List();
On Jul 28, 11:51 am, "Richard Wilde" <[email protected]> wrote:
> Is it possible to introduce a DISTINCT keyword into the generated SQL using
> QueryOver.
>
> return Session
>
> .QueryOver<Movie>() <-- I want distinct Movies
>
> .Inner.JoinQueryOver<Actor>(a => a.ActorList)
>
> .Where(a => a.Name.IsLike("m%"))
>
> .List();
>
> I suppose I am looking for something like .QueryOverDistinct<Movie>() ...
>
> If I use Projection.Distinct and project into a DTO I lose the ability to
> lazy load. What are my options?
>
> Or do I have to fall back to HQL or use a sub query?
>
> Thanks
>
> Rippo
--
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.