【发布时间】:2014-02-17 19:56:41
【问题描述】:
从 Grails 2.2.3 更新到 Grails 2.3.5(groovy 2.0.8->2.1.9)后,我发现了奇怪的行为 域对象:
class Element {
String name
String title
static constraints = {
title nullable: true
}
}
在创建时字符串字段自动修剪,空字符串替换为null
def e = new Element(name:'', title:' sgg gg ')
assert e.name==null
assert e.title=='sgg gg'
我在 Grails & groovy 的更新日志中找不到这个超级功能。如何禁用它?
【问题讨论】:
标签: grails grails-orm