Get the App
SLTechnology News&Howtos  ›  Servers  › 

What are the Validator verification annotations in Hibernate

Shulou Source: shulou.com Published: 2022-05-31 22:12:21 10月03日 Update

Editor to share with you what are the Validator verification notes in Hibernate, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

Hibernate Validator is an implementation of JSR-303. Adding Hibernate Validator annotations to FormBean is compared to defining a check class. Annotations are more concise and flexible.

Notes and instructions

Constraint @ Null annotated element built into Bean Validation must be null @ NotNull annotated element must not be null @ AssertTrue annotated element must be true @ AssertFalse annotated element must be false @ Min (value) annotated element must be a number, its value must be greater than or equal to the specified minimum value @ Max (value) annotated element must be a number Its value must be less than or equal to the specified maximum value @ DecimalMin (value) the annotated element must be a number, its value must be greater than or equal to the specified minimum value @ DecimalMax (value) the annotated element must be a number Its 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 Its value must be within the acceptable range @ Past annotated element must be a past date @ Future annotated element must be a future date @ Pattern (regex=,flag=) annotated element must conform to the specified regular expression Hibernate Validator appended constraint @ NotBlank (message =) validation string non-null And the length must be greater than 0 @ Email the annotated element must be the email 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 all the contents of the article "what are the Validator Verification comments in Hibernate" Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Comments elements comments numbers ranges validations characters strings articles maximum minimum content size date maximum value appropriate concise not much practice address Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia Apple Shulou Technology macOS Huawei