-
Notifications
You must be signed in to change notification settings - Fork 682
Interface projection with native query not working for boolean (mysql) [DATACMNS-1695] #2290
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
We should improve the error message to report the actual issue. We don't want to make any assumptions over |
Stack trace:
The offending value is |
Moving the issue back to Spring Data Commons as |
…returned. We now throw UnsupportedOperationException when a projected value cannot be returned because it cannot be brought into the target type, either via conversion or projection. This exception improves the error message by avoiding throwing IllegalArgumentException: Projection type must be an interface from the last branch that falls back into projections. Closes #2290.
…returned. We now throw UnsupportedOperationException when a projected value cannot be returned because it cannot be brought into the target type, either via conversion or projection. This exception improves the error message by avoiding throwing IllegalArgumentException: Projection type must be an interface from the last branch that falls back into projections. Closes #2290.
Michal Ondrovic opened DATACMNS-1695 and commented
Simplified test case:
Projection interface:
Query with projection:
Boolean property "test" is not recognized as Boolean but as Byte. Calling getTest() throws this exception:
java.lang.IllegalArgumentException: Projection type must be an interface!
The projection is working if the boolean field is selected directly from a table, but not, when the field is "calculated".
More workarounds are possible, in my case change "Boolean getTest()" to "Byte getTest()" is the best
Affects: 2.2.6 (Moore SR6)
The text was updated successfully, but these errors were encountered: