could not execute statement; nested exception is org.hibernate.exception.GenericJDBCException...

Mysql問題

  • 問題描述

當後端使用的是SpringJPA作爲持久層的結局方案時,前端做新增請求時報錯could not execute statement; nested exception is org.hibernate.exception.GenericJDBCException: could not execute statement


問題解決

  • 解決方式

到mysql給相應的表的 主鍵 字段設置 “自增”

  • 問題原因
    是對應的pojo的設置了id自增的註解,但是mysql本身並沒有給id設置自增,所以當新增時就出現了衝突
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章