mybatis-plus 设置主键自增
在实体类中添加@TableId注解:
@Data public class DxApplication { @TableId(type = IdType.AUTO) private Long id; private String name; private Integer sort; }
在navicat中设置id自动增长:
@Data public class DxApplication { @TableId(type = IdType.AUTO) private Long id; private String name; private Integer sort; }
在navicat中设置id自动增长: