【发布时间】:2015-05-03 10:18:00
【问题描述】:
我有这个自动生成的代码行:
EPRole validator: { EPRole r, EPUserEPRole ur ->
if (ur.EPUser == null) return
boolean existing = false
EPUserEPRole.withNewSession {
existing = EPUserEPRole.exists(ur.EPUser.id, r.id)
}
if (existing) {
return 'userRole.exists'
}
}
当我尝试编译代码时,我得到82: unexpected token: validator @ line 82, column 10.
我是 groovy 的新手,因此不胜感激。
【问题讨论】:
-
应该是epRole? EPRole 将是类
-
啊,现在我明白了。整个类是自动生成的,你是对的,错误取决于大写和小写。我怎样才能接受你的答案是正确的?
标签: groovy