1. 报错:
2. 原因:
出错代码:
if(info.getRiceCount() <= 0){ ... }
事实上 对象的riceCoun属性值为null, 于是无法用null来和0比较就报错了。
3. 解决:我的情况是在insert的时候给该字段设置默认值为0就行。