Repository navigation
Match Like on a boolean field by its string value - #81
Merged
Merged
Conversation
Like.build() on a boolean field now matches true and/or false when their name contains the search value, the same way as Like.applies(), and matches nothing when neither does. Any search value which was not truthy used to match all false rows, e.g. a global search "Utrecht" on an entity with a boolean field. Fixes #80 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #80
Like.build()on abooleanorBooleanfield now buildsIS TRUE,IS FALSE,IS NOT NULLor a never-matching predicate, depending on whether"true"and/or"false"contain the search value. This is the same asLike.applies(), and the enum branch already works this way. It avoidsLOWER()on a boolean, so PostgreSQL keeps working.Changes
Like: boolean branch viaapplies(true)andapplies(false). The never-matching predicate is shared with the enum branch. The class javadoc states the boolean behavior, and points toBool.parse()for truthy values such as"1".EntityRepositoryIT:Likeassertions on the booleanArticle.deletedand on the boolean element collectionArticle.flags.Behavior change:
Like.contains("1")on a boolean field no longer matchestrue. UseBool.parse("1")for that.🤖 Generated with Claude Opus 5.5