实体类中,用@TableId注解来设置ID自动生成策略
ID类型为一下几种:
1.@TableId(type=IdType.AUTO)----数据库ID自增
2.@TableId(type=IdType.UUID()----字符串全局唯一ID
等等。。。
全局ID生成策略:
在spring boot application配置文件中添加

实体类中,用@TableId注解来设置ID自动生成策略
ID类型为一下几种:
1.@TableId(type=IdType.AUTO)----数据库ID自增
2.@TableId(type=IdType.UUID()----字符串全局唯一ID
等等。。。
在spring boot application配置文件中添加
本文标题:Mybatis-Plus ID生成策略
本文链接:https://www.haomeiwen.com/subject/gwdxxhtx.html
网友评论