Cannot read property 'length' of null,Mybatis读取数据为null今天写项目,遇到了这个问题,使用Mybatis的****没有几次。所以还不是很熟悉。当时看到这个错误,很是懵逼,后来打印了一下要遍历的数据,才发现里面有一个为nullCannot read property 'length' of null,Mybatis读取数据为null

此时查看一下Mapper文件 

Cannot read property 'length' of null,Mybatis读取数据为null 

Mybatis生成的查询方法中,有两个很相似的方法,一个是selectByExample另外一个是selectByExampleWithBLOBs。区别在于在数据库表中有text类型的字段(大字段类型)需要用selectByExampleWithBLOBs方法查询,若用selectByExample方法查询,查询到的text类型的字段就是null。除此之外用selectByExample方法都是可以查询的!

相关文章:

  • 2021-08-16
  • 2021-10-04
  • 2022-12-23
  • 2022-12-23
  • 2021-09-20
  • 2021-07-26
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-06
  • 2021-09-30
  • 2021-08-11
  • 2021-07-17
相关资源
相似解决方案