??? ??? ???
??
class User {
Long id
Long version String login
String password
def constraints = {
login(length:5..15,blank:false,unique:true)
password(length:5..15,blank:false)
}
}??? ???? ????
|??||??|??||?? ??||
|
blank|???? ??? ??? ??? ? ??? false? ??|
|className.propertyName.blank|
|
email|???? ??? ?? ???? ????? true? ??|
|className.propertyName.email.invalid|
|
inList|??? ??? ??? ?? ????? ??|
name(inList:["Joe", "Fred", "Bob"] )
|className.propertyName.not.inList|
|
length|Groovy? range? ???? ??? ?? ??? ??? ??|
|className.propertyName.length.toolong ?? className.propertyName.length.tooshort|
|
min|java.lang.Comparable? ???? ???? ??, ???? ??|
|className.propertyName.min.notmet|
|
minLength|??? ?? ??? ?? ??? ??|
|className.propertyName.minLength.notmet|
|
minSize|Collection?? ??? ?? ??? ??|
|className.propertyName.minSize.notmet|
|
matches|??? ?? ???(regular expression)? ??|
login(matches:"[a-zA-Z]")
|className.propertyName.matches.invalid|
|
max|java.lang.Comparable? ???? ???? ??, ???? ??|
|className.propertyName.max.exceeded|
|
maxLength|??? ?? ??? ?? ??? ??|
|className.propertyName.maxLength.exceeded|
|
maxSize|Collection?? ??? ?? ??? ??|
|className.propertyName.maxSize.exceeded|
|
notEqual|??? ??? ??? ?? ?? ??? ??|
|className.propertyName.notEual|
|
nullable|false? ???? ?? ??? null? ? ??? ??|
|className.propertyName.nullable|
|
range|Groovy? range? ???? ?? ?? ?? ?? ?? ??|
age(range:minAge..maxAge)
|className.propertyName.range.toosmall ?? className.propertyName.range.toobig|
|
size|Groovy? rnage? ???? Collection?? ??? ??? ??|
|className.propertyName.size.toosmall ?? className.propertyName.size.toobig|
|
unique|??? ???(unique) ?? ??? ? ??? ????? true? ??(? ????? ??? ? ??????? ??? ?????)|
|className.propertyName.not.unique|
|
url|???? URL ???? ????? true? ??|
|className.propertyName.url.invalid|