|
Running Hibernate 4.3.6.Final I too experience the issue.
The exception is: Caused by: java.lang.IllegalArgumentException: org.hibernate.hql.internal.ast.InvalidWithClauseException: with clause can only reference columns in the driving table [select rollout, count(bTS), sum(case when bTS.status = ?1 then ?2 else ?3 end), sum(case when bTS.status = ?4 then ?2 else ?3 end), (sum(case when bTS.status = ?4 then ?2 else ?3 end) / ?5) * count(bTS) from com.nsn.nitro.project.data.jpa.domain.Rollout rollout, com.nsn.nitro.project.data.jpa.domain.RolloutAdmin rolloutAdmin, com.nsn.nitro.project.data.jpa.domain.Admin admin, com.nsn.nitro.project.data.jpa.domain.BTS bTS inner join rolloutAdmin.rollout with rolloutAdmin.rollout = rollout inner join rolloutAdmin.admin with rolloutAdmin.admin = admin inner join bTS.rollout with bTS.rollout = rollout where admin = ?6 order by (sum(case when bTS.status = ?4 then ?2 else ?3 end) / ?5) * count(bTS) desc]
|