constraints in Grails code example
Example 1: constraints in grails
class User {
String firstName
String lastName
String passwordHash
static constraints = {
firstName blank: false, nullable: false
lastName blank: false, nullable: false
passwordHash blank: false, nullable: false
}
}
Example 2: constraint in grails
class User {
...
static constraints = {
login shared: "myShared"
}
}