0
在Entity中的自增主键定义为
@Id @GeneratedValue(strategy= GenerationType.IDENTITY) private Long id;
Jpa会自动创建表的序列和主键Id列(类型为 serial8 )。SpringDataJpa在insert数据时不会写入id列的值,导致Seata AT模式在insert数据时报错 :io.seata.common.exception.ShouldNeverHappenException: pkIndex is not found