Never seen it, but likely just a weird problem with linq provider. I would 
suspect it goes away when you change .Select(x => x.Friends) to 
.SelectMany(x => x.Friends) which is what your intention is I believe.

On Thursday, February 28, 2013 4:15:03 PM UTC-7, Bill K wrote:
>
> I have an object with a child relation
>
> class User{
>  int Id;
>   List<User> Friends;
> }
>
> and I'm counting the # of friends
>
> _sess.Query<User>().Where(x=>x.user.id == 
> myUserId).Select(x=>x.Friends).Count()
>
>
> Seems nhibernate is usually generating this
>
> select cast(count(.) as SIGNED) as col_0_0_ from `User` user0_, 
> FriendsToFriends friends1_ where user0_.Id=friends1_.User_id and 
> user0_.Id=1;
>
> the count(.) is invalid, replace it with a * and everything is fine..
>
> Anyone seen this?
>

-- 

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


Reply via email to