Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to solve the problem that MybatisPlus modifies the spatio-temporal field without modification

Shulou Source: shulou.com Published: 2022-06-02 02:36:21 11月15日 Update

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!

Tags: Fields questions articles attributes time and space data comments line value interest method at the same time name entity meaning datasheet more friends knowledge ribbon Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL macOS MariaDB vpn Redmi