Skip to content

Associate value with isTrue/isFalse criteria operators #1188

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

Closed
wants to merge 2 commits into from

Conversation

mp911de
Copy link
Member

@mp911de mp911de commented Feb 28, 2022

We now associate a boolean value with both operators as those operators are rendered using equals comparison in the actual SQL text.

Should be also backported to main.

Related issue: spring-projects/spring-data-r2dbc#733

We now associate a boolean value with both operators as those operators are rendered using equals comparison in the actual SQL text.
Reduce test method visibility.
@mp911de mp911de added the type: bug A general bug label Feb 28, 2022
@schauder
Copy link
Contributor

schauder commented Mar 1, 2022

I'd like to have an integration test for this because the past has shown that not all databases properly understand booleans.

@mp911de
Copy link
Member Author

mp911de commented Mar 1, 2022

There is one in place, see JdbcRepositoryIntegrationTests.derivedQueryWithBooleanLiteralFindsCorrectValues()

@@ -427,19 +440,44 @@ void mapQueryForEnumArrayShouldMapToStringList() {
assertThat(bindings.getCondition()).hasToString("person.enum_value IN (?[$1], ?[$2])");
}

@Test // gh-733
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These test are in the R2DBC part, but the changes are for JDBC.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, the changes are in Relational but we don't have a query mapper for Spring Data Relational and we never ensured in R2DBC how isTrue is bound in R2DBC. The JDBC counterpart should be in #908.

The changes in the Criteria API are now covered with additional assertions and the JDBC change went into effect with #908.

schauder pushed a commit that referenced this pull request Mar 1, 2022
We now associate a boolean value with both operators as those operators are rendered using equals comparison in the actual SQL text.

Orginal pull request #1188
schauder pushed a commit that referenced this pull request Mar 1, 2022
Reduce test method visibility.

Orginal pull request #1188
schauder pushed a commit that referenced this pull request Mar 1, 2022
We now associate a boolean value with both operators as those operators are rendered using equals comparison in the actual SQL text.

Orginal pull request #1188
schauder pushed a commit that referenced this pull request Mar 1, 2022
Reduce test method visibility.

Orginal pull request #1188
@schauder
Copy link
Contributor

schauder commented Mar 1, 2022

Merged and ported to main.

@schauder schauder closed this Mar 1, 2022
@mp911de mp911de deleted the istrue-isfalse-querymapper branch March 1, 2022 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants