【发布时间】:2015-05-25 23:17:37
【问题描述】:
我按照我在网上找到的许多地方的说明,了解如何为 Grails 2.2.4 域对象属性在其对应的 MySQL 5.5 列上创建默认值。
不幸的是,应该具有默认值的列没有应用到它们的 MySQL 列的默认值。
以下是我的域对象代码的相关摘录。有什么问题吗?:
class SelectOption {
int minSelectCount = 0
int maxSelectCount = 1
static constraints = {
minSelectCount nullable: false, min: 0, defaultValue: "0"
maxSelectCount nullable: false, min: 1, defaultValue: "1"
}
}
【问题讨论】:
标签: grails grails-orm grails-2.2 column-defaults