hibernate jpa save 数据失败

org.springframework.dao.DataIntegrityViolationException: could not execute statement; SQL [n/a]; constraint [PRIMARY]; nested exception is org.hibernate.exception.ConstraintViolationException: could not execute statement

我手动插入了一些数据 然后一直报上面这个问题 原因是因为 主键冲突 导致
修改hibernate.自动生成的表里面的 值 就行了,改成 最大+1 的id

image.png

你可能感兴趣的:(hibernate jpa save 数据失败)