Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
521 views
in Technique[技术] by (71.8m points)

dns - Grails: if a domain has enum field, how to set maxSize constraint to it?

I am now trying to make migration in Grails, and here is my domain class:

class SomeDomain {
    String    stringField
    EnumClass enumField
    static constraints = {
        stringField nullable: true, maxSize: 100
        enumField   nullable: true, maxSize: 100    
    }
}

then if I auto generated diff groovy file,

It reflects the stringField's maxSize(100), but for enumField there are no constraints reflected such that it is of maxSize(255).

Does anyone know how to set enumField's maxSize?

question from:https://stackoverflow.com/questions/66060629/grails-if-a-domain-has-enum-field-how-to-set-maxsize-constraint-to-it

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
...