Given the following entities:
For the query:
NOTE: employee.firstName is in Person table (not Employee)
The following SQL is generated:
The alias, employees1_1_ does not correspond to any table involved in the query. Person table should have been joined with Employee because firstName is declared in Person.
Fixed in master, 5.1, and 5.0 branches.