【发布时间】:2013-05-06 12:54:05
【问题描述】:
在我的 Grails 域类中,我想设置保留在数据库中的默认值。我使用mysql作为数据库。我试着这样做:
class A {
long someValue = 1
long someOtherValue
boolean someBool = true
boolean someOtherBool
static mapping = {
someOtherValue defaultValue: 1
someOtherBool defaultValue: true
}
}
但是没有任何效果。数据库中没有设置默认值。为了正确设置默认值,我必须进行哪些更改?
【问题讨论】:
标签: grails grails-2.0 grails-domain-class