mybatis中mapUnderscoreToCamelCase的设置

在mybatis使用过程中可以使用mapUnderscoreToCamelCase自动驼峰命名转换。

在ssm项目中可以如下设置:

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration
        PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
    <settings>
        <!--开启驼峰命名-->
        <setting name="mapUnderscoreToCamelCase" value="true"/>
    </settings>
</configuration>

在springboot项目中可以如下设置:

mybatis.configuration.mapUnderscoreToCamelCase=true
或
mybatis.configuration.map-underscore-to-camel-case=true

或者是创建xml文件(configuration里面设置,再mybatis配置过程中指定文件的位置)

原文地址:https://www.cnblogs.com/zouhong/p/12791018.html