I am using Criteria to perform a query that uses an in clause. The sql being generated is invalid syntax:
select this_.CSWebID as y0_, this_.CSUserName as y1_, this_.CSStatus as y2_, this_.CSDate as y3_, this_.CSViewEdit as y4_, this_.CSReviewer as y5_, this_.CSPreview as y6_, this_.CSPreviousStatus as y7_, this_.CSComponentName as y8_ from CSWorkQueue this_ where this_.CSUserName=? and y2_ in (?, ?, ?, ?)
problem is that y2_ in the where clause is invalid, it should be this_.CSStatus instead.
I tried it using disjunctions instead and I get the same issue:
select this_.CSWebID as y0_, this_.CSUserName as y1_, this_.CSStatus as y2_, this_.CSDate as y3_, this_.CSViewEdit as y4_, this_.CSReviewer as y5_, this_.CSPreview as y6_, this_.CSPreviousStatus as y7_, this_.CSComponentName as y8_ from CSWorkQueue this_ where (y2_=? or y2_=? or y2_=? or y2_=?) and this_.CSUserName=?
Strange that it works ok for the CSUserName clause. The CSStatus is an integer and the username is a string.
Any ideas? This is hibernate 3.3.1 .
Thanks
|