How to add constraints on inherited properties in a grails domain sub-class

前端 未结 4 937
没有蜡笔的小新
没有蜡笔的小新 2021-01-01 12:05

Here\'s what I\'d like to do:

class A {
  String string
  static constraints = {
    string(maxSize:100)
  }
}

class B extends A {
  static constraints = {
         


        
4条回答
  •  星月不相逢
    2021-01-01 12:28

    You need to redeclare the superclass constraints because it's a static clojure (static properties and static methods doesn't are inherited by child classes), so, it's not mapped by GORM.

    Cheers.

提交回复
热议问题