java.sql.SQLException: Field 'supplier_id' doesn't have a default value

前端 未结 6 1673
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-03 17:14

I got an error message from this:

 java.sql.SQLException: Field \'supplier_id\' doesn\'t have a default value
    at com.mysql.jdbc.SQLError.createSQLExcepti         


        
6条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-03 18:14

    There might be two cases.

    1. You have declared the column's default value as NONE and are not not passing any value to it while inserting.

    2. You have declared the column in database, but you have not declared the same in your entity object, which is causing the error.

提交回复
热议问题