Skip to content

NH-3808 - Linq - does not support GetValueOrDefault() for Nullable<bool> #1042

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
nhibernate-bot opened this issue Oct 12, 2017 · 1 comment

Comments

@nhibernate-bot
Copy link
Collaborator

nhibernate-bot commented Oct 12, 2017

Alexander Zaytsev created an issue — 9th July 2015, 6:13:23:

System.InvalidCastException : Unable to cast object of type 'NHibernate.Hql.Ast.HqlCoalesce' to type 'NHibernate.Hql.Ast.HqlBooleanExpression'.
   at NHibernate.Hql.Ast.HqlTreeNodeExtensions.AsBooleanExpression(HqlTreeNode node) in HqlTreeNode.cs: line 123
   at NHibernate.Linq.Visitors.QueryModelVisitor.VisitWhereClause(WhereClause whereClause, QueryModel queryModel, Int32 index) in QueryModelVisitor.cs: line 261
   at Remotion.Linq.QueryModelVisitorBase.VisitBodyClauses(ObservableCollection`1 bodyClauses, QueryModel queryModel)
   at Remotion.Linq.QueryModelVisitorBase.VisitQueryModel(QueryModel queryModel)
   at NHibernate.Linq.Visitors.QueryModelVisitor.Visit() in QueryModelVisitor.cs: line 140
   at NHibernate.Linq.Visitors.QueryModelVisitor.GenerateHqlQuery(QueryModel queryModel, VisitorParameters parameters, Boolean root) in QueryModelVisitor.cs: line 86
   at NHibernate.Linq.NhLinqExpression.Translate(ISessionFactoryImplementor sessionFactory, Boolean filter) in NhLinqExpression.cs: line 67
   at NHibernate.Hql.Ast.ANTLR.ASTQueryTranslatorFactory.CreateQueryTranslators(IQueryExpression queryExpression, String collectionRole, Boolean shallow, IDictionary`2 filters, ISessionFactoryImplementor factory) in ASTQueryTranslatorFactory.cs: line 24
   at NHibernate.Engine.Query.QueryExpressionPlan.CreateTranslators(IQueryExpression queryExpression, String collectionRole, Boolean shallow, IDictionary`2 enabledFilters, ISessionFactoryImplementor factory) in QueryExpressionPlan.cs: line 32
   at NHibernate.Engine.Query.QueryExpressionPlan..ctor(IQueryExpression queryExpression, Boolean shallow, IDictionary`2 enabledFilters, ISessionFactoryImplementor factory) in QueryExpressionPlan.cs: line 14
   at NHibernate.Engine.Query.QueryPlanCache.GetHQLQueryPlan(IQueryExpression queryExpression, Boolean shallow, IDictionary`2 enabledFilters) in QueryPlanCache.cs: line 67
   at NHibernate.Impl.AbstractSessionImpl.GetHQLQueryPlan(IQueryExpression queryExpression, Boolean shallow) in AbstractSessionImpl.cs: line 412
   at NHibernate.Impl.AbstractSessionImpl.CreateQuery(IQueryExpression queryExpression) in AbstractSessionImpl.cs: line 372
   at NHibernate.Linq.DefaultQueryProvider.PrepareQuery(Expression expression, ref IQuery query, ref NhLinqExpression nhQuery) in DefaultQueryProvider.cs: line 73
   at NHibernate.Linq.DefaultQueryProvider.Execute(Expression expression) in DefaultQueryProvider.cs: line 39
   at NHibernate.Linq.DefaultQueryProvider.Execute(Expression expression) in DefaultQueryProvider.cs: line 46
   at Remotion.Linq.QueryableBase`1.GetEnumerator()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList(IEnumerable`1 source)
   at NHibernate.Test.NHSpecificTest.NH3100.NullableBooleanFixture.GetValueOrDefaultTrue() in ByCodeFixture.cs: line 121
@hazzik
Copy link
Member

hazzik commented Jul 13, 2018

Fixed by (#516).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants