3.1.0
表主键字段定义:
PBO_ID varchar(20) not null DEFAULT (UUID_SHORT());
然后Entity定义:
/**
* 主键
*/
@TableId(value = "PBO_ID")
private String pboId;
配置文件中 idType=AUTO
然后通过BaseMapper的insert插入记录之后,记录插入成功,pbo_id也有值,但是代码中entity的pboId并没有自动设置成相应的值
那你自己写个mybatis的insert看看能不能返回主键吧
数据库需要设置自增
数据库需要设置自增
好的,谢谢。
Most helpful comment
那你自己写个mybatis的insert看看能不能返回主键吧