[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-1673) hql parsed with exception (with clause)

Trygve Hardersen (JIRA) noreply at atlassian.com
Wed Jul 1 13:35:16 EDT 2009


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1673?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=33510#action_33510 ] 

Trygve Hardersen commented on HHH-1673:
---------------------------------------

I had a similar issue where a left join would reference a column from a previous left join in the "with" clause. The SQL for this works on MySQL at least, but Hibernate gave me the "with-clause referenced two different from-clause elements" error.

I checked our the 3.3.2.GA tag source and managed to build it locally. I then commented our line 447 org.hibernate.hql.ast.HqlSqlWalker where the exception is thrown, and Hibernate is now generating the correct SQL for me without complaining. I'm not sure which implications this can have, but any queries that reached that point in the code would have resulted in an exception being thrown anyway. I guess Hibernate may generate invalid queries in some cases.

> hql parsed with exception (with clause)
> ---------------------------------------
>
>                 Key: HHH-1673
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1673
>             Project: Hibernate Core
>          Issue Type: Deprecation
>          Components: query-hql
>    Affects Versions: 3.1.3
>            Reporter: Tomasz Bech
>         Attachments: HHH-1673.patch, HHH-1673.patch
>
>
> The 'improvement' bug fix: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1520
> has broken working functionality:
>  I found that after switching to 3.1.3 following construction is not working any longer:
> (FootnoteTypeBO has collection 'descriptions' and reference to languageBO)
> from FootnoteTypeBO as o
> left outer join o.descriptions as t1
> with (t1.language in (select loid from LanguageBO where name = 'aa'))
> --> exception: 'with-clause referenced two different from-clause elements'.
> There is no implicit join as dewscribed in main anomaly, so it shouldn't cause the problem. So now there is no way to write correct hql/sql, and I don't see any workaround.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list