In the integration SpringBoot Integrate MyBatis-Plus when , call selectById(id) When querying data, an error is reported
The page error message is :
In fact, you can see from the background log information :
You can see the prompt is :
Warn: Could not find @TableId in Class: com.hlt.entity.User.
class com.hlt.entity.User ,Not found @TableId annotation, Cannot use Mybatis-Plus ‘xxById’ Method.
This is because when the table does not contain a primary key , Warning given
resolvent : See if… Is set in this table id Primary key
See if the entity class is missing id Field
I am because I write less in entity class id Field , No mistake can be found everywhere , It turns out that there is something wrong with the entity class field .