Java联合主键的使用
程序员文章站
2022-04-25 07:56:02
...
- 引入jar包
<dependency>
<groupId>com.github.jeffreyning</groupId>
<artifactId>mybatisplus-plus</artifactId>
<version>1.3.1-RELEASE</version>
</dependency>
- 实体类中,联合主键对应属性加注解
@MppMultiId
@TableField(value = "k1")
private Integer k1;
@MppMultiId
@TableField(value = "k2")
private String k2;