HqlSqlWalker#handleWithFragment:
if ( referencedFromElement != fromElement ) {
JoinSequence#toJoinFragment:
if ( join.getAlias().equals( withClauseJoinAlias ) ) {
Both checks assume that the with clause uses the LHS. When a query use a with on the RHS, we throw the exception.
Realistically, this entire area needs substantial re-work. However, until then, simply warn when these conditions occur but allow it.
|