Springboot 解决Mybatis查询日期值为null
一、运行之后发现如下
二、原因
由于数据库表的字段create_time与实体类createTime对应的字段完全不一样 导致!
三、解决
(1)在application.properties中加上
#日志
mybatis.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl
#开启驼峰命名和下划线命名的自动转换
mybatis.configuration.map-underscore-to-camel-case=true
(2) 再次运行
上一篇: 几秒钟就充满电!科学
下一篇: 暂无数据