You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To do a count over distinct we need to wrap into sub select
select
distinct order0_.ShippedDateas col_0_0_,
order0_.OrderDateas col_1_0_
from
Orders order0_ ;
selectcount(*) as col_0_0
from ( select
distinct order0_.ShippedDateas col_0_0_,
order0_.OrderDateas col_1_0_
from
Orders order0_ ) as q
But my knowledge of the Expressions is not that good to do a proper wrap in the TransformCountExpression
Error message:
System.NotSupportedException : New
at NHibernate.Linq.Visitors.HqlGeneratorExpressionVisitor.VisitExpression(Expression expression) in B:\source\nhibernate-core\src\NHibernate\Linq\Visitors\HqlGeneratorExpressionVisitor.cs:line 150
at NHibernate.Linq.Visitors.HqlGeneratorExpressionVisitor.VisitNhDistinct(NhDistinctExpression expression) in B:\source\nhibernate-core\src\NHibernate\Linq\Visitors\HqlGeneratorExpressionVisitor.cs:line 299
at NHibernate.Linq.Visitors.HqlGeneratorExpressionVisitor.VisitExpression(Expression expression) in B:\source\nhibernate-core\src\NHibernate\Linq\Visitors\HqlGeneratorExpressionVisitor.cs:line 138
at NHibernate.Linq.Visitors.HqlGeneratorExpressionVisitor.VisitNhCount(NhCountExpression expression) in B:\source\nhibernate-core\src\NHibernate\Linq\Visitors\HqlGeneratorExpressionVisitor.cs:line 271
at NHibernate.Linq.Visitors.HqlGeneratorExpressionVisitor.VisitExpression(Expression expression) in B:\source\nhibernate-core\src\NHibernate\Linq\Visitors\HqlGeneratorExpressionVisitor.cs:line 136
at NHibernate.Linq.Visitors.HqlGeneratorExpressionVisitor.Visit(Expression expression) in B:\source\nhibernate-core\src\NHibernate\Linq\Visitors\HqlGeneratorExpressionVisitor.cs:line 45
at NHibernate.Linq.Visitors.SelectClauseVisitor.Visit(Expression expression) in B:\source\nhibernate-core\src\NHibernate\Linq\Visitors\SelectClauseVisitor.cs:line 88
at NHibernate.Linq.Visitors.SelectClauseVisitor.VisitSelector(Expression expression, Boolean isSubQuery) in B:\source\nhibernate-core\src\NHibernate\Linq\Visitors\SelectClauseVisitor.cs:line 60
at NHibernate.Linq.Visitors.QueryModelVisitor.GetSelectClause(Expression selectClause) in B:\source\nhibernate-core\src\NHibernate\Linq\Visitors\QueryModelVisitor.cs:line 481
at NHibernate.Linq.Visitors.QueryModelVisitor.VisitSelectClause(SelectClause selectClause, QueryModel queryModel) in B:\source\nhibernate-core\src\NHibernate\Linq\Visitors\QueryModelVisitor.cs:line 472
at Remotion.Linq.Clauses.SelectClause.Accept(IQueryModelVisitor visitor, QueryModel queryModel)
at Remotion.Linq.QueryModelVisitorBase.VisitQueryModel(QueryModel queryModel)
at NHibernate.Linq.Visitors.QueryModelVisitor.Visit() in B:\source\nhibernate-core\src\NHibernate\Linq\Visitors\QueryModelVisitor.cs:line 172
at NHibernate.Linq.Visitors.QueryModelVisitor.GenerateHqlQuery(QueryModel queryModel, VisitorParameters parameters, Boolean root, Nullable`1 rootReturnType) in B:\source\nhibernate-core\src\NHibernate\Linq\Visitors\QueryModelVisitor.cs:line 108
at NHibernate.Linq.NhLinqExpression.Translate(ISessionFactoryImplementor sessionFactory, Boolean filter) in B:\source\nhibernate-core\src\NHibernate\Linq\NhLinqExpression.cs:line 97
at NHibernate.Hql.Ast.ANTLR.ASTQueryTranslatorFactory.CreateQueryTranslators(IQueryExpression queryExpression, String collectionRole, Boolean shallow, IDictionary`2 filters, ISessionFactoryImplementor factory) in B:\source\nhibernate-core\src\NHibernate\Hql\Ast\ANTLR\ASTQueryTranslatorFactory.cs:line 21
at NHibernate.Engine.Query.QueryExpressionPlan.CreateTranslators(IQueryExpression queryExpression, String collectionRole, Boolean shallow, IDictionary`2 enabledFilters, ISessionFactoryImplementor factory) in B:\source\nhibernate-core\src\NHibernate\Engine\Query\QueryExpressionPlan.cs:line 37
at NHibernate.Engine.Query.QueryExpressionPlan..ctor(IQueryExpression queryExpression, Boolean shallow, IDictionary`2 enabledFilters, ISessionFactoryImplementor factory) in B:\source\nhibernate-core\src\NHibernate\Engine\Query\QueryExpressionPlan.cs:line 19
at NHibernate.Engine.Query.QueryPlanCache.GetHQLQueryPlan(IQueryExpression queryExpression, Boolean shallow, IDictionary`2 enabledFilters) in B:\source\nhibernate-core\src\NHibernate\Engine\Query\QueryPlanCache.cs:line 76
at NHibernate.Impl.AbstractSessionImpl.GetHQLQueryPlan(IQueryExpression queryExpression, Boolean shallow) in B:\source\nhibernate-core\src\NHibernate\Impl\AbstractSessionImpl.cs:line 611
at NHibernate.Impl.AbstractSessionImpl.CreateQuery(IQueryExpression queryExpression) in B:\source\nhibernate-core\src\NHibernate\Impl\AbstractSessionImpl.cs:line 579
at NHibernate.Linq.DefaultQueryProvider.PrepareQuery(Expression expression, IQuery& query) in B:\source\nhibernate-core\src\NHibernate\Linq\DefaultQueryProvider.cs:line 208
at NHibernate.Linq.DefaultQueryProvider.Execute(Expression expression) in B:\source\nhibernate-core\src\NHibernate\Linq\DefaultQueryProvider.cs:line 94
at NHibernate.Linq.DefaultQueryProvider.Execute[TResult](Expression expression) in B:\source\nhibernate-core\src\NHibernate\Linq\DefaultQueryProvider.cs:line 101
at NHibernate.Test.Linq.ByMethod.DistinctTests.DistinctCountOnComplexAnonymousTypeProjection() in B:\source\nhibernate-core\src\NHibernate.Test\Linq\ByMethod\DistinctTests.cs:line 74
at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
The text was updated successfully, but these errors were encountered:
Following test fails (in
DistinctTests.cs
)To do a count over distinct we need to wrap into sub select
But my knowledge of the Expressions is not that good to do a proper wrap in the
TransformCountExpression
Error message:
The text was updated successfully, but these errors were encountered: