Case insensitive Constraints via ignoreCase method per Constraint subtype that can support it#1006
Conversation
Signed-off-by: Nathan Rauh <nathan.rauh@us.ibm.com>
4cf77a0 to
20536d4
Compare
|
Now that TextExpression.upper/lower went in and provided an alternative to ignoreCase for Restriction, we had a discussion on today's Jakarta Data call about how to cover case insensitive for the pattern of Constraint parameters being supplied to repository methods. The other solution under #1005 was preferred by all 5 participants on the call instead of the solution under this PR, so at this time, I am not planning to resolve the merge conflicts within this PR. |
|
Sorry I could not make it to the call today, I had an exam at the same time.
I'm not particularly a fan of either approach, so I agree that we don't need to move forward with this one, which adds quite a lot of complexity for something of really quite marginal value. Seems to me that the most parsimonious thing to do — supposing we need to even do anything at this stage — would be to add the concept of case-insensitivity back to
Note that for the cases which are not covered by |
|
Closing this in favor of #1005 |
Option 2 for case insensitive Constraints:
Add
.ignoreCase()to specific subtypes ofConstraintthat are capable of case insensitive comparisons when operating onStringvalues. This includesLike,NotLike,EqualTo,NotEqualTo,Between,NotBetween, and the various GT/LT/GTE/LTE constraints. If a user ever invokesignoreCase()on a constraint that has a non-String value, it will raise UnsupportedOperationException.Provide an
isCaseSensitive()method for each of these same subtypes to determine if aConstraintperforms case insensitive comparisons, defaulting it based on whether the value is aString(trueforStringandfalsefor others). When it starts astrue, an instance withfalsecan be obtained by invokingignoreCase().Example usage:
We should choose between this PR or #1005 (or if someone thinks of another way) for case-insensitive constraints