-
Notifications
You must be signed in to change notification settings - Fork 1.5k
JSqlParserQueryEnhancer errors with INSERT statements #2593
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Yeah you are totally right. When working on a344a76 I did not though about |
The `detectParsedType()` inside `JSqlParserQueryEnhancer` is now aware of `INSERT` statements, which means `INSERT` statements can now be used in native queries. Closes spring-projects#2593
Hey @DiegoKrupitza and @gregturn ! |
Hey @DiegoKrupitza and @gregturn ! When will the 2.7.x release be fixed? |
Hey @DaDom & @tofdragon. Unfortunately I don't know if this will be backported to 2.7.x, since this is decided(?)/managed by the members of the spring-data-jpa team. There is currently a lot happening with QueryEnhancer so I think the next big change (#2639) will not be backported, so in the future it may be feasible to "upgrade". But this is just my personal opinion maybe the leads of this project have other plans. Hope this somehow helps :) |
The `detectParsedType()` inside `JSqlParserQueryEnhancer` is now aware of `INSERT` statements, which means `INSERT` statements can now be used in native queries. Closes #2593
Backported to |
When starting a Spring Boot application with >= 2.7.0 the application fails to start if it has native INSERT queries defined in JpaRepositories. The error is:
java.lang.ClassCastException: class net.sf.jsqlparser.statement.insert.Insert cannot be cast to class net.sf.jsqlparser.statement.select.Select
For example, any JpaRepository with the following will error and prevent the application from starting:
detectParsedType()
appears to neglect the Insert statement type:The text was updated successfully, but these errors were encountered: