Mybatis tinyint(1)自动转boolean

使用Mybatis查询tinyint(1)字段数据,返回值为Map类型,那么tinyint(1)的数据默认会转化为boolean类型数据.
解决方案:
  1.使用ifnull(column, 0)处理该字段,个人测试过可以;
  2.在jdbcUrl添加参数:tinyInt1isBit=false(默认为true)
  3.避免使用长度为1的tinyint类型字段存储数字格式的数据;

posted @ 2018-05-03 14:35  guuyoog  Views(1295)  Comments(0Edit  收藏  举报