无法在Grails 2.4.4文档中获得示例。 (扩展RestfulController超类)

时间:2015-07-03 22:02:13

标签: grails groovy

我一直在尝试在Grails 2.4.4文档中实现this示例,但我似乎无法获得要编译的源代码。

我遇到问题的代码是:

@Override
protected Score queryForResource(Serializable id) {
    Score.where {
        id == id && Game.id = params.GameId  //Error
    }.find()
}

IDE警告上述代码中标记为错误的行发生错误。 IDE错误是:

((id == id) && Game.id) is a binary expression, but it should be a variable expression at line: 16 column: 33.

编译错误是:

  [groovyc] org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
  [groovyc] C:\Users\PC_2\Documents\Grails\WS\grails-app\controllers\ws\ScoreController.groovy: 16: 
  [groovyc] ((id == id) && Game.id) is a binary expression, but it should be a variable expression at line: 16 column: 33. File: C:\Users\PC_2\Documents\Grails\WS\grails-app\controllers\ws\ScoreController.groovy @ line 16, column 33.
  [groovyc]                id == id && Game.id = params.authorId
  [groovyc]                                    ^
  [groovyc] 
  [groovyc] 1 error

如果需要其他信息来解决问题,我会尽力提供。谢谢!

0 个答案:

没有答案