赞
踩
简单来说:代码自动识别的login_id与数据库loginId名不一致
这是一个映射错误问题
- @Data
- @TableName("t_user_basic")
- public class User implements Serializable {
-
- @TableId(value = "id", type = IdType.AUTO)
- private Integer id;
-
- private String loginId;
-
- private String nickName;
-
- private String pwd;
-
- private String headImg;
-
- }
原先代码上加入 @TableField("数据库属性名")
- @Data
- @TableName("t_user_basic")
- public class User implements Serializable {
-
- @TableId(value = "id", type = IdType.AUTO)
- private Integer id;
-
- @TableField("loginId")
- private String loginId;
-
- @TableField("nickName")
- private String nickName;
-
- private String pwd;
-
- @TableField("headImg")
- private String headImg;
-
- }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。