Loading

执行报错:@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 @ 2023-04-30 09:58  北兢王  阅读(5561)  评论(0)    收藏  举报