但是使用注解方式时,经过一番查找资料才找到比较好的设置方法。如下:
在spring boot的配置文件application.properties中,加入配置项:
1 mybatis.configuration.mapUnderscoreToCamelCase=true
2 或
3 mybatis.configuration.map-underscore-to-camel-case=true
设为true表示开启驼峰转换。经过试验,两种配置方法都可以。但如果同时配置,前者mybatis.configuration.mapUnderscoreToCamelCase的优先级更高。