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

HQL: parser is trying to reuse parent implied join for subquery

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects versions: 3.2.0.GA, 3.3.0.CR1
    • Fix versions: 3.3.0.CR1
    • Components: Core
    • Labels:
    • Sprint:

      Description

      Following query (Northwind model) does work

      session.CreateQuery(@"select c from OrderLine c
      join c.Order o
      where o.Customer.CustomerId = '123'
      and exists (from c.Order.Employee.Subordinates xxx where xxx.EmployeeId = 1)
      ").List<OrderLine>();

      And does not work when first join is implied:

      session.CreateQuery(@"from OrderLine c
      where c.Order.Customer.CustomerId = '123'
      and exists (from c.Order.Employee.Subordinates xxx where xxx.EmployeeId = 1)
      ").List<OrderLine>();

      Exception is throwing

      NHibernate.QueryException : could not resolve property: EmployeeId of: NHibernate.DomainModel.Northwind.Entities.Order [from OrderLine c
      where c.Order.Customer.CustomerId = '123'
      and exists (from c.Order.Employee.Subordinates xxx where xxx.EmployeeId = 1)
      ]

      at NHibernate.Persister.Entity.AbstractPropertyMapping.ToType(String propertyName) in AbstractPropertyMapping.cs: line 37

        Attachments

          Issue links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                hazzik Alexander Zaytsev
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Who's Looking?