Remember the pit of Mybatis once

Remember the pit of Mybatis

The field design of the login table in the database is in the form of user_login_*, and in Java Pojo it is in the form of userLoginId.
Then when I used mybatis to connect to the database to query, I found that the sql statement was fine, but it just couldn't be encapsulated. Later, I found the reason, and it turned out that the hump naming method in mybatis was not turned on. Therefore, it has not been encapsulated in the entity. Paste the configuration code in springBoot below:

//mybatis 开启驼峰命名
mybatis.configuration.map-underscore-to-camel-case=true

Guess you like

Origin blog.csdn.net/weixin_43901067/article/details/100066480