SpringBoot中MyBatis属性映射之开启驼峰命名 |
您所在的位置:网站首页 › mybatis开启驼峰映射后大小写和下划下都可以吗 › SpringBoot中MyBatis属性映射之开启驼峰命名 |
MyBatis默认是属性名和数据库字段名一一对应的,即 数据库表列:user_name 实体类属性:user_name 或者 数据库表列:AppID 实体类属性:appid 与数据库大小写无关,实体类统一小写 但是java中一般使用驼峰命名 数据库表列:user_name 实体类属性:userName 或者 数据库表列:USER_NAME 实体类属性:userName 在SpringBoot中,可以通过设置map-underscore-to-camel-case属性为true来开启驼峰功能: mybatis: configuration: map-underscore-to-camel-case: true # 开启驼峰命名 |
今日新闻 |
点击排行 |
|
推荐新闻 |
图片新闻 |
|
专题文章 |
CopyRight 2018-2019 实验室设备网 版权所有 win10的实时保护怎么永久关闭 |