Skip to content

Case insensitive Constraints via IgnoreCase annotation #1005

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

njr-11
Copy link
Contributor

@njr-11 njr-11 commented Mar 6, 2025

Option 1 for case insensitive Constraints:
Give the repository method author an @IgnoreCase annotation with which to indicate when a Constraint should be applied independent of case. Typically it will be known upfront that the database contains a mixture of case, and it will be more convenient to specify this information in a single place on the repository method signature rather than everywhere it is used (where there is also the risk of forgetting to do it in one place).

Example usage:

List<Book> booksTitled(@IgnoreCase Constraint<String> title);

found = library.booksTitled(Constraint.equalTo("Developing with Jakarta Data"));

We should choose between this PR or #1006 (or if someone thinks of another way) for case-insensitive constraints

@otaviojava
Copy link
Contributor

Comparing those two options, I would stay with this one.

@gavinking, what do you think?

@gavinking
Copy link
Contributor

what do you think?

I think I would not introduce a new top-level construct in our API for something marginally-useful with perfectly reasonable alternative solutions (JDQL, Restrictions).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants