Hi All,
I ran into a problem with subqueries and
filters, where the order of the parameters (positional and filter parameters,
not named parameters) got messed up. I searched through the forum and JIRA and
found to similar issues:
1)
NH-1098 (I’m not sure, if
it’s exactly the same problem, but pretty much sounds like it)
2)
http://forum.hibernate.org/viewtopic.php?t=971270
After some debugging I think I found the
problem in method ProcessFilters in QueryParameters (line 369 ff.). There,
the SQL parts of the statement are analyzed and the parameters are added to the
SQL string. During the loop the parameters (positional and filter) are added in
the order they occur in the parts list, but only the filter parameters are
added to the parameter list. After processing the parts, the positional
parameters are added at the end of the parameter list, which may result in a wrong
order.
I worked out a fix for the problem, but I’m
not sure, if it does not cause other problems and would appreciate it if
somebody could have a look on it. I can provide the fix and a test case. Should
I open a new JIRA issue or should I upload the information to NH-1098 ?
Best Regards,
Wolfgang