错误提示:
[aad8bbfc419f1d20]Caused by: org.apache.ibatis.exceptions.PersistenceException:
[aad8bbfc419f1d20]### Error querying database. Cause: java.lang.NullPointerException: target is null for method size
[aad8bbfc419f1d20]### Cause: java.lang.NullPointerException: target is null for method size
排查:
空指针肯定是某个属性没绑定上
<select id="findRepertoryDayTotal" resultType="int">
select
count(*)
from cluster_sams.app_sams_cloud_item_inventory_days_d
<where>
<!-- 时间为空, 默认日期 -->
<if test="(repertoryDateStart == null or repertoryDateStart == '') or (repertoryDateEnd == null or repertoryDateEnd == '')">
and event_date between yesterday() and today()
</if>
<!-- 时间不为空, 库存日期 -->
<if test="(repertoryDateStart != null and repertoryDateStart != '') and (repertoryDateEnd != null and repertoryDateEnd !=

本文记录了一次由于属性绑定错误引发的`org.apache.ibatis.exceptions.PersistenceException`问题。通过错误提示和排查过程,发现是属性名`postions`缺少了字母`s`导致的空指针异常。解决方案是细致检查所有属性名和条件表达式,确保正确无误。
最低0.47元/天 解锁文章
313

被折叠的 条评论
为什么被折叠?



