[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-7321) HQL: Combining a CROSS JOIN with a LEFT JOIN which requires a WITH clause triggers an exception.

negora (JIRA) noreply at atlassian.com
Wed May 16 07:39:09 EDT 2012


    [ https://hibernate.onjira.com/browse/HHH-7321?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46674#comment-46674 ] 

negora commented on HHH-7321:
-----------------------------

Oh, I forgot to mention these entities attributes too:

- Student.studentAnswerList

- Question.studentAnswerList

What I mean basically is that the entities description seems to be OK.

> HQL: Combining a CROSS JOIN with a LEFT JOIN which requires a  WITH clause triggers an exception.
> -------------------------------------------------------------------------------------------------
>
>                 Key: HHH-7321
>                 URL: https://hibernate.onjira.com/browse/HHH-7321
>             Project: Hibernate ORM
>          Issue Type: Bug
>          Components: query-hql
>    Affects Versions: 4.1.0, 4.1.3
>         Environment: JDK 7.0 Update 4
> JBoss AS 7.0.1 Final
>            Reporter: negora
>
> I'm trying to combine a CROSS JOIN with a LEFT JOIN. The last one requires a WITH clause that references one of tables used in the CROSS JOIN. For example, I want to list students, questions of an exam, and their answers to them. Some answers may not exist, thus I'm using a LEFT JOIN:
> SELECT s.studentId, q.questionId, sa.answer
> FROM Student s, Question q
> LEFT JOIN s.studentAnswerList AS sa WITH sa.question.questionId = q.questionId
> This causes an exception: javax.ejb.EJBException: java.lang.IllegalArgumentException: org.hibernate.hql.internal.ast.QuerySyntaxException: with-clause referenced two different from-clause elements .
> The entities are really simple. These are their attributes:
> - Student.studentId
> - Question.questionId
> - StudentAsnwer.studentAnswerId
> - StudentAsnwer.studentId
> - StudentAsnwer.questionId
> - StudentAsnwer.answer
> I've been suffering from the same problem in both 3.x and 4.x versions of Hibernate.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list