-
Notifications
You must be signed in to change notification settings - Fork 132
MSSQL: Using IsTrue or True in Query Method doesn't work on BIT columns #698
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
4 tasks
See also spring-projects/spring-data-relational#908 This is a bug and we need to fix it. We fixed a similar bug already in Spring Data JDBC. |
This was referenced Feb 28, 2022
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Provided the following schema and Java code:
Schema
Book DTO
Book Repository
Any attempts to call
existsByIdAndAvailableTrue()
throws the following error:io.r2dbc.mssql.ExceptionFactory$MssqlBadGrammarException: Invalid column name 'TRUE'.
The query that the function generates is as follows:
SELECT Books.id, Books.name, Books.available FROM Books WHERE Books.id = @P0_id AND (Books.available = TRUE)
The expected behavior should be that, given a BIT column mapped to a Java Boolean value, Spring Data R2DBC should be able to correctly check whether the BIT column is
TRUE
orFALSE
.The text was updated successfully, but these errors were encountered: