[hibernate-issues] [Hibernate-JIRA] Created: (HHH-6777) HQL "in" transformed to incorrect SQL with Oracle dialect

Michael Zeising (JIRA) noreply at atlassian.com
Thu Oct 27 04:24:21 EDT 2011


HQL "in" transformed to incorrect SQL with Oracle dialect
---------------------------------------------------------

                 Key: HHH-6777
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6777
             Project: Hibernate Core
          Issue Type: Bug
          Components: query-hql
    Affects Versions: 4.0.0.Beta5
         Environment: JBoss AS 7.0.1.Final, Hibernate Core 4.0.0.Beta5, Oracle 10g
            Reporter: Michael Zeising
            Priority: Critical


The HQL query

{{select c.left_id, c.right_id from Allocation_Conflict c where c.planning_id = :planningId and ((c.left_id in :allocationIds) or (c.right_id in :allocationIds))}}

is translated to

{{... (c.left_id in ?, ?) or (c.right_id in ?, ?)}}

which leads to the Oracle error "ORA-00907: missing right parenthesis". The workaround is to write

{{... ((c.left_id in (:allocationIds)) or (c.right_id in (:allocationIds)))}}

which is not intented because Hibernate adds the parenthesis automatically in other queries.

--
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