nhibernate/nhibernate-core — pull request #44 by hazzik (2012-01-09 08:49:03+00:00)
Title: NH-3002: HQL parser is trying to reuse parent implied join for subquery

Folowing query works fine

```csharp
session.CreateQuery(@"select c from OrderLine c
join c.Order o
where o.Customer.CustomerId = 'VINET'
and not exists (from c.Order.Employee.Subordinates x where x.EmployeeId = 100)
").List();
```

While similar one with implied join throws exception

```
NHibernate.QueryException : could not resolve property: EmployeeId of: NHibernate.DomainModel.Northwind.Entities.Order

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

```csharp
session.CreateQuery(@"from OrderLine c
where c.Order.Customer.CustomerId = 'VINET'
and exists (from c.Order.Employee.Subordinates x where x.EmployeeId = 100)
").List();
```

JIRA: https://nhibernate.jira.com/browse/NH-3002

Also covers similar queries in linq https://nhibernate.jira.com/browse/NH-2999 and https://nhibernate.jira.com/browse/NH-2988