很简单,因为你在建立数据库表的时候,没有指定主键生成策略,所以你在用hibernate插入数据的时候,如果没有指定主键的值,那么就没有主键当然无法插入,所以在nvcicat设置一下主键生成策略就好了
相关文章
- ERROR: Field 'PostId' doesn't have a default value Exception in thread "main" org.hibernate.exception.GenericJDBCException: could not execute statement
- mybatis向mysql数据库中插入数据报错Field 'id' doesn't have a default value
- Field 'id' doesn't have a default value
- java.sql.SQLException: Field 'name' doesn't have a default value
- Field 'id' doesn't have a default value
- MySQL之Field‘***’doesn’t have a default value错误解决办法
- hibernate:Field 'id' doesn't have a default value 原因
- Field 'id' doesn't have a default value
- Field 'id' doesn't have a default value解决
- Field 'id' doesn't have a default value