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