Skip to content

Match Like on a boolean field by its string value - #81

Merged
BalusC merged 1 commit into
developfrom
feature/like-on-boolean
Nov 4, 2026
Merged

BalusC merged 1 commit into
developfrom
feature/like-on-boolean

Conversation

@BalusC

@BalusC BalusC commented Nov 4, 2026

Copy link
Copy Markdown
Member

Fixes #80

Like.build() on a boolean or Boolean field now builds IS TRUE, IS FALSE, IS NOT NULL or a never-matching predicate, depending on whether "true" and/or "false" contain the search value. This is the same as Like.applies(), and the enum branch already works this way. It avoids LOWER() on a boolean, so PostgreSQL keeps working.

Changes

  • Like: boolean branch via applies(true) and applies(false). The never-matching predicate is shared with the enum branch. The class javadoc states the boolean behavior, and points to Bool.parse() for truthy values such as "1".
  • EntityRepositoryIT: Like assertions on the boolean Article.deleted and on the boolean element collection Article.flags.

Behavior change: Like.contains("1") on a boolean field no longer matches true. Use Bool.parse("1") for that.

🤖 Generated with Claude Opus 5.5

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>
@BalusC
BalusC merged commit e6ed9d5 into develop Nov 4, 2026
3 checks passed
@BalusC
BalusC deleted the feature/like-on-boolean branch November 4, 2026 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant