mybatis中mapUnderscoreToCamelCase的设置

时间:2020-04-28 00:21:25   收藏:0   阅读:259

在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

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!