I have searched through various GPT and CSDN articles, but have not found the correct solution. It is commonly said that the issue is with the XML file location...
Error Code#
- User Class
- Mapper Interface
- Test Method
Solution and Reason#
Since the primary key is not specified in the User entity class, the
selectById
method cannot find the primary key.
Therefore, the solution is to add @TableId
in the User entity class to specify the primary key @TableId(value = "user_id", type = IdType.AUTO)