0
我很困惑。我有一个非常简单的查询。Grails控制器类中的HQL查询产生ClassCastException?
def value = Contribution.executeQuery(
'select sum(c.balance) from Contribution c where
c.account.id=:accountId', [accountId: memberInstance?.account?.id])
我交互式调试,以及我能 - 没有要求的情况下为null(memberInstance,memberInstance.account)。但是由此产生的错误是一个ClassCastException?
Stacktrace follows:
java.lang.ClassCastException: com.myapp.contribution.ContributionService cannot be cast to com.myapp.contribution.ContributionService
at com.myapp.contribution.ContributionService$$FastClassByCGLIB$$d800d90.invoke(<generated>) ...
没有人有任何线索,为什么正在生成一个CCE中,而且,为什么一个类类型不能投给自己(反正不是我明白为什么Grails的应该做的吗?)
谢谢!
阿里克斯
你见过这个? http://stackoverflow.com/q/4855483/1123341 – 2012-01-10 20:57:02