在dao中自定义了一个查询语句,是查询一个数据表中的某一列的总和。自定义查询语句如下:
@Query(value = "SELECT Sum(account.money) FROM account")
double totalMoney();
报错现象:
java.lang.IllegalStateException: Failed to load ApplicationContext
...此处省略N句代码...
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'accountServiceImpl': Unsatisfied dependency expressed through field