Name | Example | Description |
blank | title(blank:false) | Set to false if a string value cannot be blank |
email(email:true) | Set to true if the value must be an email address | |
inList | sex(inList:['Man','Woman']) | Value must be contain within the given list |
length | title(length:1..50) | Use a range value to restrict the length of string or range |
min | age(min:new Date() | Set the minimun value |
minLength | title(minLength:5) | Set the minimum length of a string or array property |
minSize | children(minSize:10) | Set the minimum size of a collection or number property |
matches | name(matches:/[a-zA-Z]/) | Matches the supplied regular expression |
max | age(max:new Date() | Set the maximum value |
maxLength | title(maxLength:5) | Set the maximum length of a string or array property |
maxSize | children(maxSize:10) | Set the maximum size of a collection or number property |
notEqual | name(notEqual:'Eric') | Must not equal the special value |
nullable | name | Set to false if property value cannot be null |
range | age(range:30..60) | Must occur within the special range |
size | children(size:5..15) | Use a range to restrict the size of a collection or number |
unique | name(unique:true) | Set to true if the property must be unique |
url | url(url:true) | Set to true if a string value is a url address |
Monday, March 17, 2008
Constraint in Grails
Grails use constraint key word for Domain class's constraint.As a note,I summary the constraint in Grails Domain Model.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment