attempted to return null from a method with a primitive return type (int).

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了attempted to return null from a method with a primitive return type (int).相关的知识,希望对你有一定的参考价值。

鏍囩锛?a href='http://www.mamicode.com/so/1/post' title='post'>post   灏变細   閬垮厤   with   class   div   temp   鍘熷洜   return   

閿欒淇℃伅:

attempted to return null from a method with a primitive return type (int).

閿欒鍘熷洜:
瀹為檯鏌ヨsql骞舵病鏈夎繖涓€硷紝鍑虹幇绌哄€硷紝灏变細鎶ヨ繖涓紓甯搞€?br />

閿欒sql(鍙戠敓闂):

select sum(id) from post where post.author = ?

姝g‘sql(瑙e喅闂):

select IFNULL(sum(id),0) from post where post.author = ?

鍏抽敭鍦ㄤ簬浣跨敤浜咺FNULL锛屾湁浜嗚繖涓垽鏂彲閬垮厤浠讳綍鎯呭喌绌哄€煎鑷寸殑閿欒銆?/p>

以上是关于attempted to return null from a method with a primitive return type (int).的主要内容,如果未能解决你的问题,请参考以下文章

attempted to return null from a method with a primitive return type (Double).

attempted to return null from a method with a primitive return type (int).

attempt to create delete event with null entity

java.lang.IllegalArgumentException: attempt to create saveOrUpdate event with null entity

Attempted to call method length on null context object和“arrays.length(tag.blogs)“ (template: “tags“)

Attempt to invoke interface method 'boolean java.util.List.add(java.lang.Object)' on a null