Null return value from advice does not match primitive return type for

org.springframework.web.util.NestedServletException: Request processing failed; nested exception is 
org.springframework.aop.AopInvocationException: Null return value from advice does not match primitive return type for:

public abstract int com.*.VoterDao.todayCountVote(java.util.Date)

下面是我的dao层

@Query("select sum(v.daysNum) from Voter v where v.updateTime>?1")
int todayCountVote(Date date);

应该是自动拆箱的时出现的问题,把int换成 Integer 包装类就行了,如果还报空指针的错误,就加个null判空。

完!

 

posted @ 2020-04-25 08:59  风起时的悟  阅读(2521)  评论(0编辑  收藏  举报