扫码关注官方订阅号
人生最曼妙的风景,竟是内心的淡定与从容!
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
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
count函数返回的就是数值类型,不会得到null
会不会为
null这取决于你的sql跟ibatis没有任何关系。select count(1) from test where 1=0你可以使用这个sql证明一下会不会为null。直接强转成
Integer不会,但是拆箱会。