How to solve the problem that MybatisPlus modifies the spatio-temporal field without modification
This article mainly introduces how to solve the problem that MybatisPlus modifies the spatio-temporal field without modification, which has a certain reference value, and interested friends can refer to it. I hope you will gain a lot after reading this article.
Problem description:
A problem encountered today is that when updating data, MybatisPlus does not modify datasheet fields whose properties are empty.
Solution:
You only need to add a line of comments to the attributes of the entity class
/ * * name * / @ TableField (fill = FieldFill.UPDATE) private String name
This line of comments means that when the name property is modified, a value (the default is null) is automatically populated, which means that the field is changed to empty rather than left unmodified.
Thank you for reading this article carefully. I hope the article "how to solve the problem that MybatisPlus modifies the spatio-temporal field without modification" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support and pay attention to the industry information channel. More related knowledge is waiting for you to learn!