执行报错:@TableId can‘t more than one in Class

报错信息

nested exception is com.baomidou.mybatisplus.core.exceptions.MybatisPlusException: @TableId can't more than one in Class: "com.sangeng.domain.entity.ArticleTag"

解决方案

将使用MyBatisX生成的实体类中错误添加的@TableId注解删掉

@TableName(value ="sg_article_tag")
@Data
public class ArticleTag implements Serializable {
    /**
     * 文章id
     */
    @TableId(type = IdType.AUTO)
    private Long articleId;

    /**
     * 标签id
     */
//    @TableId
    private Long tagId;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}
posted @   北兢王  阅读(4762)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 25岁的心里话
· 闲置电脑爆改个人服务器(超详细) #公网映射 #Vmware虚拟网络编辑器
· 零经验选手,Compose 一天开发一款小游戏!
· 因为Apifox不支持离线,我果断选择了Apipost!
· 通过 API 将Deepseek响应流式内容输出到前端
点击右上角即可分享
微信分享提示
主题色彩