Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to solve the problem that @ TableField is not effective in Mybatis-plus

2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces how to solve the problem that @ TableField does not take effect in Mybatis-plus. It is very detailed and has certain reference value. Interested friends must read it!

Mybatis-plus 's pit @ TableField does not work event regression

The entity class definition field is underlined

Fields in sql are also underlined.

Mybatiplus defaults to turning on automatic conversion of underscores, so the field is null.

The annotation @ TableField (value= "field name") does not take effect

Mybatis-plus: # mapper scan mapper-locations: classpath*:mapper/**/*.xml configuration: # turn off automatic hump conversion map-underscore-to-camel-case: false # print sql log-impl: org.apache.ibatis.logging.stdout.StdOutImpl@TableField

1. Only @ TableField is added, but MetaObjectHandler is not implemented.

2. The MetaObjectHandler implementation class is not added to the spring container

3. Fields marked with @ TableField have no get or set methods

4. The type of the field marked with @ TableField is not consistent with the type passed during binding. For example, if the field type is String and Integer is passed, it will become invalid.

The above is all the contents of this article entitled "how to solve the problem that @ TableField does not take effect in Mybatis-plus". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report