mybatis源码修改解决使用中的问题

来源:互联网 发布:python twisted 过时 编辑:程序博客网 时间:2024/06/04 17:55

     在使用mybatis时,有时想返回的记录不是map而是list,只要修改org.apache.ibatis.executor.resultset.FastResultSetHandler.getRowValue方法。

     如图,加上if-else语句

     

      另外一个问题就是返回类型为map时,当返回的记录的字段值为空时,该字段不会被put,只要修改

      org.apache.ibatis.executor.resultset.FastResultSetHandler.applyAutomaticMappings方法,注释掉那两条语句就行: