Join ordering logic wrongly pushes cross joins from subqueries to parent

Description

The logic in org.hibernate.hql.internal.ast.tree.FromClause#moveFromElementToEnd is faulty as it doesn't handle the fact that destination from elements could be on a different from clause level, leading to wrong SQL being generated.

Environment

None
Fixed

Assignee

Christian Beikov

Reporter

Christian Beikov

Fix versions