例子
class Hotel{
static constraints = {
name()
crTime(nullable:true)
upTime(nullable:true)
}
String name
Date crTime
Date upTime
def beforeInsert = {
crTime = new Date()
}
def beforeUpdate = {
upTime = new Date()
}
}
crTime(nullable:true)
upTime(nullable:true)不设 保存或更新静默失败(beforeInsert或beforeUpdate 不起作用)
posted on 2009-08-28 15:50
冰是没有未来的,因为它的永恒 阅读(607)
评论(0) 编辑 收藏 所属分类:
grails