Uploaded image for project: 'NHibernate [Moved to GitHub]'
  1. NH-3001

NHibernate.HibernateException: Query Source could not be identified

    Details

    • Sprint:

      Description

      After upgrading to trunk build the following test, that used to work on 3.2 now fails:

      var query = from foo in Session.Query<Foo>()
      join bar in Session.Query<Bar>()
      on foo equals bar.Foo
      group bar by bar.RunTask.Id
      into temp
      select new

      { temp.Key, count = temp.Count()}

      ;

      var result = query.ToList();

      NHibernate.HibernateException: Query Source could not be identified: ItemName = <generated>_1, ItemType = Namespace.Bar, Expression = from Bar <generated>_1 in foo
      at NHibernate.Linq.QuerySourceNamer.GetName(IQuerySource querySource) in d:\BuildAgent-03\work\642d14aa2ecb6f73\src\NHibernate\Linq\QuerySourceNamer.cs: line 28
      at NHibernate.Linq.Visitors.HqlGeneratorExpressionTreeVisitor.VisitQuerySourceReferenceExpression(QuerySourceReferenceExpression expression) in d:\BuildAgent-03\work\642d14aa2ecb6f73\src\NHibernate\Linq\Visitors\HqlGeneratorExpressionTreeVisitor.cs: line 187
      at NHibernate.Linq.Visitors.HqlGeneratorExpressionTreeVisitor.VisitExpression(Expression expression) in d:\BuildAgent-03\work\642d14aa2ecb6f73\src\NHibernate\Linq\Visitors\HqlGeneratorExpressionTreeVisitor.cs: line 108
      at NHibernate.Linq.Visitors.HqlGeneratorExpressionTreeVisitor.VisitNhCount(NhCountExpression expression) in d:\BuildAgent-03\work\642d14aa2ecb6f73\src\NHibernate\Linq\Visitors\HqlGeneratorExpressionTreeVisitor.cs: line 161
      at NHibernate.Linq.Visitors.HqlGeneratorExpressionTreeVisitor.VisitExpression(Expression expression) in d:\BuildAgent-03\work\642d14aa2ecb6f73\src\NHibernate\Linq\Visitors\HqlGeneratorExpressionTreeVisitor.cs: line 124
      at NHibernate.Linq.Visitors.HqlGeneratorExpressionTreeVisitor.Visit(Expression expression) in d:\BuildAgent-03\work\642d14aa2ecb6f73\src\NHibernate\Linq\Visitors\HqlGeneratorExpressionTreeVisitor.cs: line 32
      at NHibernate.Linq.Visitors.SelectClauseVisitor.VisitExpression(Expression expression) in d:\BuildAgent-03\work\642d14aa2ecb6f73\src\NHibernate\Linq\Visitors\SelectClauseVisitor.cs: line 59
      at Remotion.Linq.Parsing.ExpressionTreeVisitor.VisitAndConvert(T expression, String methodName) in :line 0
      at Remotion.Linq.Parsing.ExpressionTreeVisitor.<>c_DisplayClass6`1.<VisitAndConvert>b_5(T expression) in :line 0
      at Remotion.Linq.Parsing.ExpressionTreeVisitor.VisitList(ReadOnlyCollection`1 list, Func`2 visitMethod) in :line 0
      at Remotion.Linq.Parsing.ExpressionTreeVisitor.VisitAndConvert(ReadOnlyCollection`1 expressions, String callerName) in :line 0
      at Remotion.Linq.Parsing.ExpressionTreeVisitor.VisitNewExpression(NewExpression expression) in :line 0
      at Remotion.Linq.Parsing.ExpressionTreeVisitor.VisitExpression(Expression expression) in :line 0
      at NHibernate.Linq.Visitors.SelectClauseVisitor.VisitExpression(Expression expression) in d:\BuildAgent-03\work\642d14aa2ecb6f73\src\NHibernate\Linq\Visitors\SelectClauseVisitor.cs: line 66
      at NHibernate.Linq.Visitors.SelectClauseVisitor.Visit(Expression expression) in d:\BuildAgent-03\work\642d14aa2ecb6f73\src\NHibernate\Linq\Visitors\SelectClauseVisitor.cs: line 36
      at NHibernate.Linq.Visitors.QueryModelVisitor.VisitSelectClause(SelectClause selectClause, QueryModel queryModel) in d:\BuildAgent-03\work\642d14aa2ecb6f73\src\NHibernate\Linq\Visitors\QueryModelVisitor.cs: line 200
      at Remotion.Linq.Clauses.SelectClause.Accept(IQueryModelVisitor visitor, QueryModel queryModel) in :line 0
      at Remotion.Linq.QueryModelVisitorBase.VisitQueryModel(QueryModel queryModel) in :line 0
      at NHibernate.Linq.Visitors.QueryModelVisitor.Visit() in d:\BuildAgent-03\work\642d14aa2ecb6f73\src\NHibernate\Linq\Visitors\QueryModelVisitor.cs: line 109
      at NHibernate.Linq.Visitors.QueryModelVisitor.GenerateHqlQuery(QueryModel queryModel, VisitorParameters parameters, Boolean root) in d:\BuildAgent-03\work\642d14aa2ecb6f73\src\NHibernate\Linq\Visitors\QueryModelVisitor.cs: line 57
      at NHibernate.Linq.NhLinqExpression.Translate(ISessionFactoryImplementor sessionFactory) in d:\BuildAgent-03\work\642d14aa2ecb6f73\src\NHibernate\Linq\NhLinqExpression.cs: line 64
      at NHibernate.Hql.Ast.ANTLR.ASTQueryTranslatorFactory.CreateQueryTranslators(String queryIdentifier, IQueryExpression queryExpression, String collectionRole, Boolean shallow, IDictionary`2 filters, ISessionFactoryImplementor factory) in d:\BuildAgent-03\work\642d14aa2ecb6f73\src\NHibernate\Hql\Ast\ANTLR\ASTQueryTranslatorFactory.cs: line 27
      at NHibernate.Engine.Query.HQLExpressionQueryPlan.CreateTranslators(String expressionStr, IQueryExpression queryExpression, String collectionRole, Boolean shallow, IDictionary`2 enabledFilters, ISessionFactoryImplementor factory) in d:\BuildAgent-03\work\642d14aa2ecb6f73\src\NHibernate\Engine\Query\HQLExpressionQueryPlan.cs: line 34
      at NHibernate.Engine.Query.HQLExpressionQueryPlan..ctor(String expressionStr, IQueryExpression queryExpression, String collectionRole, Boolean shallow, IDictionary`2 enabledFilters, ISessionFactoryImplementor factory) in d:\BuildAgent-03\work\642d14aa2ecb6f73\src\NHibernate\Engine\Query\HQLExpressionQueryPlan.cs: line 23
      at NHibernate.Engine.Query.HQLExpressionQueryPlan..ctor(String expressionStr, IQueryExpression queryExpression, Boolean shallow, IDictionary`2 enabledFilters, ISessionFactoryImplementor factory) in d:\BuildAgent-03\work\642d14aa2ecb6f73\src\NHibernate\Engine\Query\HQLExpressionQueryPlan.cs: line 17
      at NHibernate.Engine.Query.QueryPlanCache.GetHQLQueryPlan(IQueryExpression queryExpression, Boolean shallow, IDictionary`2 enabledFilters) in d:\BuildAgent-03\work\642d14aa2ecb6f73\src\NHibernate\Engine\Query\QueryPlanCache.cs: line 88
      at NHibernate.Impl.AbstractSessionImpl.GetHQLQueryPlan(IQueryExpression queryExpression, Boolean shallow) in d:\BuildAgent-03\work\642d14aa2ecb6f73\src\NHibernate\Impl\AbstractSessionImpl.cs: line 312
      at NHibernate.Impl.AbstractSessionImpl.CreateQuery(IQueryExpression queryExpression) in d:\BuildAgent-03\work\642d14aa2ecb6f73\src\NHibernate\Impl\AbstractSessionImpl.cs: line 268
      at NHibernate.Linq.DefaultQueryProvider.PrepareQuery(Expression expression, ref IQuery query, ref NhLinqExpression nhQuery) in d:\BuildAgent-03\work\642d14aa2ecb6f73\src\NHibernate\Linq\DefaultQueryProvider.cs: line 69
      at NHibernate.Linq.DefaultQueryProvider.Execute(Expression expression) in d:\BuildAgent-03\work\642d14aa2ecb6f73\src\NHibernate\Linq\DefaultQueryProvider.cs: line 33
      at NHibernate.Linq.DefaultQueryProvider.Execute(Expression expression) in d:\BuildAgent-03\work\642d14aa2ecb6f73\src\NHibernate\Linq\DefaultQueryProvider.cs: line 40
      at Remotion.Linq.QueryableBase`1.GetEnumerator() in :line 0
      at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
      at System.Linq.Enumerable.ToList(IEnumerable`1 source)

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              kkozmic k
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Who's Looking?