探索Mybatis中Mapper默认返回值

文章目录 背景 源码分析 背景 ​ 最近写业务代码时会遇到如下查询,若StudentMapper中的listByName方法返回null而非空的list,则在该业务代码的第二行就会容易抛出NPE,为了消除代码的副作用,需要结合Mybatis源码来分析该次查询若没有数据是返回null还是空的list。 业务代码: List<Student> students = studentMapper.list
相关文章
相关标签/搜索