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判空。

完!

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM