原因:Insert或Update数据时违反了完整性,例如违反了惟一性限制;
操作:
重点:
在实体类的id上加注解(生成策略核心注解):
@GenericGenerator(name = "jpa-uuid", strategy = "uuid")
@GeneratedValue(generator = "jpa-uuid")
复制代码
在实体类的id上加注解(生成策略核心注解):
@GenericGenerator(name = "jpa-uuid", strategy = "uuid")
@GeneratedValue(generator = "jpa-uuid")
复制代码
转载于:https://juejin.im/post/5b94f81de51d450ea131f996