1. 写了一个很简单查询全部数据的demo接口,结果一直返回null. 数据库明明有数据而且在console控制台也可以查到,但是用接口访问一直返回null
2.后发现原来是数据库中字段名和对象的属性名称对不上,所以可以在yml文件中加上
mybatis:
configuration:
map-underscore-to-camel-case: true
mapper-locations: classpath:mapper/*Mapper.xml
1. 写了一个很简单查询全部数据的demo接口,结果一直返回null. 数据库明明有数据而且在console控制台也可以查到,但是用接口访问一直返回null
2.后发现原来是数据库中字段名和对象的属性名称对不上,所以可以在yml文件中加上
mybatis:
configuration:
map-underscore-to-camel-case: true
mapper-locations: classpath:mapper/*Mapper.xml