The following queries fail in hibernate due to what seems like incorrect logic for determining whether the parameter needs to be surrounded by parentheses.
select * from (
select e.name, d.name from employee =e
join department d on e.deptid = d.id
where d.id in :deptIds
)
with empDepts as (
select e.name, d.name from employee =e
join department d on e.deptid = d.id
where d.id in :deptIds
) select * from empDepts
The problem seems to be that Hibernate treats the closing parenthese after :deptIds as already "enclosing" the parameterList so doesn't add parentheses, thus making the query invalid.
Workaround 1: Add dummy whitespace after the deptIds binding
select * from (
select e.name, d.name from employee =e
join department d on e.deptid = d.id
where d.id in :deptIds
)
Workaround 2: Put the parentheses in yourself (better)
select * from (
select e.name, d.name from employee =e
join department d on e.deptid = d.id
where d.id in (:deptIds)
)
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira