使用SpringBoot做JAVA开发时,用Repository.save();保存数据的时候遇到了报错:

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

去搜索了一下解决方法,需要将主键设置自增,虽然不清楚为什么,但是将主键设置自增之后确实解决问题了,以后清楚原因之后再来补上。

相关文章:

  • 2022-12-23
  • 2022-01-21
  • 2021-04-11
  • 2021-05-17
  • 2022-12-23
  • 2021-07-21
  • 2021-10-26
  • 2021-04-22
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-02-14
  • 2021-06-22
  • 2021-05-31
  • 2021-10-08
相关资源
相似解决方案