-
Notifications
You must be signed in to change notification settings - Fork 60
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
feat: Support UUID filtering in PropertyStringFilter #3363
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, thank you for contributing to Hilla!
I did a quick code check and requested some changes, let me know what you think.
} else if (javaType == UUID.class) { | ||
switch (this.filter.getMatcher()) { | ||
case EQUALS -> { | ||
return criteriaBuilder.equal(propertyPath, UUID.fromString(value)); | ||
} | ||
case CONTAINS -> throw new IllegalArgumentException("A UUID cannot be filtered using contains"); | ||
case GREATER_THAN -> | ||
throw new IllegalArgumentException("A UUID cannot be filtered using greater than"); | ||
case LESS_THAN -> throw new IllegalArgumentException("A UUID cannot be filtered using less than"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sure your code is compliant with Java 17
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cromoteca Thank you for reviewing my PR.
I've set my .java-version
to 17 and run jenv local
to confirm I'm on 17.
When I run ./mvnw clean package
it runs without any errors.
What additional checks can I make?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's weird because in Java 17 enhanced switches must explicitly cover all possible cases and null
is not covered here. But of course the compiler knows more than me and if it's happy I'm happy too.
packages/java/endpoint/src/test/java/com/vaadin/hilla/crud/TestObject.java
Outdated
Show resolved
Hide resolved
packages/java/endpoint/src/test/java/com/vaadin/hilla/crud/filter/FilterTransformerTest.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, thanks for the PR. While we're reviewing it, could you, please, sign the CLA? We require it from all contributors. Here is the link again (same as in the comment): https://cla-assistant.io/vaadin/hilla?pullRequest=3363
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3363 +/- ##
=======================================
Coverage 86.89% 86.89%
=======================================
Files 115 115
Lines 8289 8289
Branches 1271 1271
=======================================
Hits 7203 7203
Misses 1072 1072
Partials 14 14
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Description
Allow users to pass a PropertyStringFilter for a UUID field.
Fixes #3362
Type of change
Checklist
Additional for
Feature
type of change