AnnotationApply onRuntime checkingHibernate Metadata impact@Length(min=, max=)property (String)check if the string length match the rangeColumn length will be set to max@Max(value=)property (numeric or string representation of a numeric)check if the value is less than or equals to maxAdd a check constraint on the column@Min(value=)property (numeric or string representation of a numeric)check if the value is more than or equals to minAdd a check constraint on the column@NotNullpropertycheck if the value is not nullColumn(s) are not null@NotEmptypropertycheck if the string is not null nor empty. Check if the connection is not null nor emptyColumn(s) are not null (for String)@Pastproperty (date or calendar)check if the date is in the pastAdd a check constraint on the column@Futureproperty (date or calendar)check if the date is in the futurenone@Pattern(regex="regexp", flag=) or @Patterns( {@Pattern(...)} )property (string)check if the property match the regular expression given a match flag (see java.util.regex.Pattern )none@Range(min=, max=)property (numeric or string representation of a numeric)check if the value is between min and max (included)Add a check constraint on the column@Size(min=, max=)property (array, collection, map)check if the element size is between min and max (included)none@AssertFalsepropertycheck that the method evaluates to false (useful for constraints expressed in code rather than annotations)none@AssertTruepropertycheck that the method evaluates to true (useful for constraints expressed in code rather than annotations)none@Validproperty (object)perform validation recursively on the associated object. If the object is a Collection or an array, the elements are validated recursively. If the object is a Map, the value elements are validated recursively.none@Emailproperty (String)check whether the string is conform to the email address specificationnone@CreditCardNumberproperty (String)check whether the string is a well formated credit card number (derivative of the Luhn algorithm)none@Digitsproperty (numeric or string representation of a numeric)check whether the property is a number having up to integerDigits integer digits and fractionalDigits fractonal digitsdefine column precision and scale@EANproperty (string)check whether the string is a properly formated EAN or UPC-A codenone

文章链接

评论可见,请评论后查看内容,谢谢!!!
 您阅读本篇文章共花了: