mybatisplus set NULL
时间: 2023-10-03 09:09:55 浏览: 116
MybatisPlus,无XML分分钟实现CRUD操作
5星 · 资源好评率100%
To set a column value to NULL in MyBatis Plus, you can use the `nullValue` property in the `@TableField` annotation or the `set` method when updating the entity.
1. Using `@TableField` annotation:
```java
@TableField(nullValue = "NULL")
private String columnName;
```
2. Using the `set` method:
```java
yourEntity.setColumnName(null);
```
By setting the column value to null, MyBatis Plus will generate the corresponding SQL statement to update the column with a NULL value in the database.
阅读全文