| Author |
HQL complex left joins and WITH clause
|
Kanat Serikbayev
Greenhorn
Joined: Sep 13, 2012
Posts: 1
|
|
Hello, everyone
I'm completely new to Hibernate and at the moment I'm stuck with a task to convert a native query to HQL.
I'm using Hibernate 4.1.6. The query contains a lot of left joins. I'm having a problem with a left join that has a reference to the previous left join.
This is how the native query looks like:
Specifically I'm having problems with this line
Hibernate provides WITH clause that can be used instead of ON. So I rewrote the query the following way:
However, for some reason it seems to be not possible to reference the previous left join in this case (WITH rSL.locale = oSL.locale).
I get an exception stating
org.hibernate.hql.internal.ast.InvalidWithClauseException: with clause can only reference columns in the driving table
Am I doing something wrong? Or is that a limitation of HQL? If it's a limitation, is there a workaround to solve this problem?
|
 |
Bill Gorder
Bartender
Joined: Mar 07, 2010
Posts: 1282
|
|
|
There were some JIRA's with this functionality breaking in certain versions of hibernate. What are receiptStatus and receiptStatusLns?
|
[How To Ask Questions][Read before you PM me]
|
 |
 |
|
|
subject: HQL complex left joins and WITH clause
|
|
|