How do I set a fixed length String in Grails constraints?
I have this domain class
class Client {
String idCard
...
static constraints = {
idCard size:16
...
}
}
I created some test data in bootstrap.groovy file
But I am getting the following error
Caused by IllegalArgumentException: Parameter for constraint [size] of property [idCard] of class [class ni.sb.Client] must be a of type [groovy.lang.IntRange]
I need this property to be a string and have a fixed length
I follow the documentation size limits with no success
Thank you for your time
+3
source to share