Last active
March 6, 2018 16:24
-
-
Save djalexd/5abb6815b17952e46d864e684e5e9cf2 to your computer and use it in GitHub Desktop.
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
| class User { | |
| @NotNull | |
| String firstName; | |
| } | |
| void validate(User user) { | |
| return javax.validation.Validation | |
| .buildDefaultValidatorFactory() | |
| .getValidator() | |
| .validate(user); | |
| } | |
| /* if user.firstName is null, validation will fail with 'firstName' PropertyPath */ | |
| /* how can the PropertyPath be adjusted to 'first_name'? */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment