SpelQueryContext::SpelExtractor doesn't support SQL comments
Hi
In my development team, we've recently made a huge Spring component's version upgrade ... on a legacy code base 😋
Amongst other things, we've upgraded from spring-data-commons:1.11.6.RELEASE to spring-data-commons:2.6.3
During the subsequent non regression tests, we've noticed the following trouble with 2.6.3, that didn't occurred with former version :
Whenever a query passed to SpelQueryContext::SpelExtractor contains /* ... */ comments in it, themself containing quotes, it can lead to have some Spel binding parameters not been processed.
For exemple, with the following query :
SELECT
a,
b
FROM
aTable t
WHERE
/* some criteria's filtering : */
t.c = :#{#aPojo.aField}
/* some other criteria's filtering : */
AND t.d = :#{#aPojo.anotherField}
the :#{#aPojo.aField} parameter won't be considered by the SpelExtractor.
Indeed, because of the two quotes in both SQL comments, it's considered as been in a quoted area.
If something can be done about it, it would be great, although it's not such a big of a problem, I agree with you ;)
In the mean time we'll get ride of quotes in our comments, but we'll keep them as been SQL ones, and won't change them into Java ones, because it's more convenient this way whenever we move the query around between Intellij and our SQL edition tools 😄