[JIRA] (HHH-16397) Wrong SQL when HQL has subquery using FK attribute