validate

内建约束

注解应用目标运行时检查Hibernate元数据效果
@Length(min=, max=)property (String)check if the string length match the rangeColumn length will be set to max
@Length(min=, max=)property (String)检查字符串长度是否符合范围列长度会被设到最大值
@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
@Max(value=)property (numeric or string representation of a numeric)检查值是否小于或等于最大值对列增加一个检查约束
@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
@Min(value=)property (numeric or string representation of a numeric)检查值是否大于或等于最小值对列增加一个检查约束
@NotNullpropertycheck if the value is not nullColumn(s) are not null
@NotNullproperty检查值是否非空(not null)列不为空
@Pastproperty (date or calendar)check if the date is in the pastAdd a check constraint on the column
@Pastproperty (date or calendar)检查日期是否是过去时对列增加一个检查约束
@Futureproperty (date or calendar)check if the date is in the futurenone
@Futureproperty (date or calendar)检查日期是否是将来时none
@Pattern(regex="regexp", flag=)property (string)check if the property match the regular expression given a match flag (see java.util.regex.Pattern )none
@Pattern(regex="regexp", flag=)property (string)检查属性是否与给定匹配标志的正则表达式相匹配(见 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
@Range(min=, max=)property (numeric or string representation of a numeric)检查值是否在最小和最大值之间(包括临界值)对列增加一个检查约束
@Size(min=, max=)property (array, collection, map)check if the element size is between min and max(included)none
@Size(min=, max=)property (array, collection, map)检查元素大小是否在最小和最大值之间(包括临界值)none
@AssertFalsepropertycheck that the method evaluates to false (useful forconstraints expressed in code rather than annotations)none
@AssertFalseproperty检查方法的演算结果是否为false(对以代码方式而不是注解表示的约束很有用)none
@AssertTruepropertycheck that the method evaluates to true (useful for constraints expressed in code rather than annotations)none
@AssertTrueproperty检查方法的演算结果是否为true(对以代码方式而不是注解表示的约束很有用)none
@Validproperty (object)Perform validation recursively on the associatedobjectnone
@Validproperty (object)对关联对象递归的进行验证none
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值