Jeecg外部引入的表,如何设置自增类型的主键

找到生成代码的entity类的主键字段

/**id*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "id")
private java.lang.Integer id;

 

把上面的 type = IdType.ASSIGN_ID 改成 type = IdType.AUTO 即可

 

@TableId(type = IdType.AUTO)
@ApiModelProperty(value = "id")
private java.lang.Integer id;

 

posted on 2021-04-09 15:20  Neo0820  阅读(1163)  评论(2编辑  收藏  举报

导航