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配置过程中指定文件的位置)

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM