In the development, we may encounter that mybatisplus uses entity class attribute for SQL operation. The entity has this attribute, but the database table does not have this field (that is, entity class attribute is not a database table field). If you don’t handle it, you will report an error.
FIRE
@TableName: Database Table Related
@TableId: table primary key identifier
@TableField: table field identifier
@TableLogic: Table field logical processing annotation (logical deletion
)
Solution
@TableField(exists = false): indicates that the property is not a database table field, but is required to be used.
@TableField(exists = true): indicates that the property is a database table field.
After adding this annotation to the attributes of the entity class, this field will not map to the database.
@TableField(exist = false)
private String deptName;
Read More:
- Tkmybatis uses Example.SetOrderByClause Use for sorting and multiple sort fields
- [Solved] MybatisPlus Error: Error querying database. Cause: java.lang.IndexOutOfBoundsException
- Mybatis Add Datas error: ERROR: Field * doesn‘t have a default value
- [SQL ERROR] SQL Error: could not execute statement & query did not return a unique result: 2; nested excepti
- Front end error: exceptionmessage: null [How to Solve]
- [305]MYSQL 1062 error: duplicate entry ‘…’ for key ‘primary
- How to quickly locate the problem in DB2-407 error reporting SQLCODE: -407, SQLSTATE: 23502
- Error creating foreign key in MySQL: 1215 cannot add the foreign key constraint
- Introduction to Relational Databases in SQL
- SqlSugar Connect MySql 8.0.29 Error [How to Solve]
- Mybatis Error: The server time zone value ‘����1532a0’ is unrecognized
- mysqli_ Error() has no return value (Fixed)
- [MySQL] The principle of group by aggregation function and the reason for aggregation limitation SELECT list is not in GROUP BY clause and contains nonaggregated column
- MYSQL: CURRENT_TIMESTAMP & ON UPDATE CURRENT_TIMESTAMP
- [Two Methods] Ora-00904: invalid group by error identifier
- [Solved] Daily further: database error: unknown column ‘model’ in ‘field list‘
- [Solved] ORA-04063: package body “SYS.DBMS_DATAPUMP“ has errors
- [Solved] Description: Failed to configure a DataSource: ‘url‘ attribute is not specified and no embedded
- How to Solve Navicat open view error
- How to Fix MySQL error 1005: can’t create table (errno: 150)