You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, Since changes in spring boot 3.1.1 (to be precise, in spring-data-jpa 3.1.1), SQLText fails to correctly parse expressions like ....where my_number like('%'||?||'%').
spring boot replaces where my_number like %:paramName% with where my_number like CONCAT('%',:paramName,'%') and hibernate in turn translates this to where my_number like ('%'||?||'%').
Unfortunately SQLText incorrectly detects here the jsonb operator ?| / ?&, instead of recognizing it as a concat operation.
As far as I can tell, this regression was introduced in this commit. b41dac8
I have experimented with some workarounds.
Patch hibernates class ConcatPipeFunction, to generate a translated statement of where my_number like ('%' || ? || '%') (added whitespaces), which makes SQLText again correctly parse the expressions parameters.
Patch SQLText to lookahead another character if there is another pipe character, suggesting a concat. Idk if this works all the time, or if there need to be more checks.
Replace jpql queries with || expression directly so, instead of hibernate translating it to '%'||?||'%', I write it myself exactly as '%' || ? || '%').
I guesss, Quickest fix for me would be Nr. 1. This fix has less complexity than Nr 2, But Nr 2. would be better in the long term.
The text was updated successfully, but these errors were encountered:
Hi, Since changes in spring boot 3.1.1 (to be precise, in spring-data-jpa 3.1.1), SQLText fails to correctly parse expressions like
....where my_number like('%'||?||'%')
.spring boot replaces
where my_number like %:paramName%
withwhere my_number like CONCAT('%',:paramName,'%')
and hibernate in turn translates this towhere my_number like ('%'||?||'%')
.Unfortunately SQLText incorrectly detects here the jsonb operator ?| / ?&, instead of recognizing it as a concat operation.
As far as I can tell, this regression was introduced in this commit.
b41dac8
I have experimented with some workarounds.
where my_number like ('%' || ? || '%')
(added whitespaces), which makes SQLText again correctly parse the expressions parameters.I guesss, Quickest fix for me would be Nr. 1. This fix has less complexity than Nr 2, But Nr 2. would be better in the long term.
The text was updated successfully, but these errors were encountered: