@AssertTrue//For the Boolean field, the field can only be true @AssertFalse//The value of the field can only be false @CreditCardNumber//a rough verification of the credit card number @DecimalMax/ /can only be less than or equal to the value @DecimalMin//can only be greater than or equal to the value @Digits (integer= 2, fraction= 20)//Check whether it is a number of integers, fractions, decimal digits. @Email//Check if it is a valid Email address @Future//Check whether the date of the field is a future date @Length (min=,max=)//Check whether the length of the field to which it belongs is between Min and Max, only for strings @Max// The value of the field can only be less than or equal to the value @Min//The field's value can only be greater than or equal to the value @NotNull//cannot be null @NotBlank//cannot be empty, the check will ignore the space @NotEmpty//cannot be empty, where null is the empty string @ NULL//Check that the field is empty @Past//the date in which the field was checked is in the past @Size (min=, max=)//Check if the Size of the field is between Min and Max, which can be a string, array, collection, map, and so on @URL (protocol=,ho St,port)//Check if it is a valid URL, and if Protocol,host is provided, the URL must also meet the conditions provided @Valid//The note is used whenever the field is a field that contains a collection of other objects or a map or array. Or the field is a reference to a different object directly,//so that the object referenced by the field is checked as well as the current object
Here are the categories
Built-in constraint in Bean Validation
@Null The annotated element must be Null
@NotNull annotated element must not be null
@AssertTrue The annotated element must be true
@AssertFalse The annotated element must be false
@Min (value) The annotated element must be a number whose value must be greater than or equal to the specified minimum value
@Max (value) The annotated element must be a number whose value must be less than or equal to the specified maximum value
@DecimalMin (value) The annotated element must be a number whose value must be greater than or equal to the specified minimum value
@DecimalMax (value) The annotated element must be a number whose value must be less than or equal to the specified maximum value
@Size (max=, min=) the size of the annotated element must be within the specified range
@Digits (integer, fraction) The annotated element must be a number whose value must be within an acceptable range
@Past The annotated element must be a past date
@Future The annotated element must be a future date
@Pattern (regex=,flag=) The annotated element must conform to the specified regular expression
Hibernate Validator Additional constraint
@NotBlank (message =) validation string is not null and must be longer than 0
@Email The annotated element must be an e-mail address
@Length (min=,max=) The size of the annotated string must be within the specified range
@NotEmpty The annotated string must be non-empty
@Range (min=,max=,message=) The annotated element must be within the appropriate range
Hibernate Validation Notes