I Figured this out. The exception mensioned, is caught inside NH, and it 
doesn't break the query. I was debuging code in Visual Studio with enabled 
"stop on thrown exception" option. And thought I had "only my code" option 
switched on, for some strange reason exception from NH are shown. My 
collegue pointed out that line of code with caught exceptions is 
highlighted in green, and uncaught are yellow.

On Wednesday, September 14, 2016 at 6:25:06 PM UTC+3, Broken Pipe wrote:
>
> Also asked at stackoverflow site: 
> http://stackoverflow.com/questions/39493202/nhibernate-queryover-with-subquery-using-parent-root-alias-could-not-resolve
>
> I'm trying to write QueryOver with subquery, which references root query 
> property inside it using this code:
>
> Entity root = null;var query = Session.QueryOver(() => root);var subQuery = 
> QueryOver.Of<Entity>();
> subQuery.Where((x) => x.Id == root.Id).Select(Projections.RowCount());
> query.WithSubquery.WhereValue(0).Eq(subQuery);
> query.List();
>
>
>
> This doesn't work, because: NHibernate.QueryException: could not resolve 
> property: root of: Entity
>

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/nhusers.
For more options, visit https://groups.google.com/d/optout.

Reply via email to