[hibernate-issues] [JIRA] (HHH-6151) HQL with joins in sub-select creates wrong SQL (copy of NH-2648)