【发布时间】:2012-05-28 17:22:43
【问题描述】:
我的 Grails 应用运行良好。如果我没记错的话,我所做的只是将我的一个域类的约束从 blank: true, nullable:true 更改为 blank:false ,可为空:假。现在,当我尝试创建该类的新实例时,我收到以下错误消息:
Property [contract] of class [class com.app.Request] cannot be null
Property [description] of class [class com.app.Request] cannot be null
Property [productline] of class [class com.app.Request] cannot be null
Property [requestType] of class [class com.app.Request] cannot be null
Property [subject] of class [class com.app.Request] cannot be null
我已经为所有这些属性提供了值。
我猜 gorm 和数据库之间存在一些冲突。有人可以向我解释发生了什么以及如何解决它。
【问题讨论】:
-
可能是针对现有实例?我的意思是数据库中的数据,是否所有指定字段都具有非空值?
-
@IgorArtamonov 很有趣。非空字段中有空值,但我之前有这些,一切正常。我不知道这怎么可能是个问题。你能详细说明一下吗?
标签: mysql grails grails-orm