人生最曼妙的风景,竟是内心的淡定与从容!
count函數回傳的就是數值類型,不會得到null
會不會為null这取决于你的sql跟ibatis没有任何关系。select count(1) from test where 1=0 你可以使用这个sql证明一下会不会为null。
null
sql
ibatis
select count(1) from test where 1=0
直接強轉成Integer不會,但拆箱會。
Integer
int i = (Integer) null; //NullPointer Exception Integer i1 = (Integer) null; //null
count函數回傳的就是數值類型,不會得到null
會不會為
null
这取决于你的sql
跟ibatis
没有任何关系。select count(1) from test where 1=0
你可以使用这个sql
证明一下会不会为null
。直接強轉成
Integer
不會,但拆箱會。