I have a trait and the following domain classes:
trait Named {
String name
static constraints = {
name blank:false, unique:true
}
}
@Entity
class Person implements Named {
String fullName
static constraints = {
fullName nullable:true
}
}
@Entity
class Category implements Named {
}
In this setup the Named.constraints are working fine for Category
, but are ignored for Person
.
How can I include the constrains from a trait in a constraints
block of an implementing domain class?