Mybatis-plus: @TableId 只能在实体类中定义一个吗,关系表怎么处理?

Created on 14 Jun 2020  ·  3Comments  ·  Source: baomidou/mybatis-plus

当前使用版本(必填,否则不予处理)

spring-boot2.3.1-RELEASE
mybatis-plus-3.3.2

该问题是如何引起的?(确定最新版也有问题再提!!!)

分别升级mysql-plus和spring-boot后出现的。

重现步骤(如果有就写完整)

1.从3.2.0升级到最新版本的mysql-plus
2.spring-boot从2.2.0-RELEASE升级到2.3.1-RELEASE
重新启动项目,报上面的错误提示。
我将mybaits回滚到3.2.0之后 问题消失。

报错信息

com.baomidou.mybatisplus.core.exceptions.MybatisPlusException: @TableId can't more than one in Class:

Most helpful comment

只能定义一个吗,两个主键的怎么整

All 3 comments

mybatis-plus回滚到3.3.1也没有问题.....最新版不香吗?

只能定义一个,之前没报错只是因为代码问题没走到报错语句上而已

只能定义一个吗,两个主键的怎么整

Was this page helpful?
0 / 5 - 0 ratings