[hibernate-issues] [JIRA] (HHH-3389) HQL generates wrong sql when using subquery on the same table