mybatis數據庫字段帶下劃線,映射支持java類屬性駝峯命名

 

在mybatis-config.xml文件裏配置數據庫

 

<configuration>
    <!-- 全局配置 -->
    <settings>
       <!--是否開啓自動駝峯命名規則(camel case)映射,即從經典數據庫列名 A_COLUMN 到經典 mybatis

Java 屬性名 aColumn 的相似映射。 -->
        <setting name="mapUnderscoreToCamelCase" value="true"/>
    </settings>
</configuration>xml

相關文章
相關標籤/搜索