[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-6777) HQL "in" transformed to incorrect SQL with Oracle dialect
Strong Liu (JIRA)
noreply at atlassian.com
Thu Nov 3 14:49:19 EDT 2011
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-6777?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=44232#comment-44232 ]
Strong Liu commented on HHH-6777:
---------------------------------
a simple test case would help a lot, thanks
> 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
> Labels: HQL, dialect
>
> 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