配置文件代码段:
<id name="id">
<generator class="native"></generator>
</id>
错误详情:
Hibernate: insert into student (id, name) values (null, ?)
hibernate.exception.ConstraintViolationException: could not insert: [fh.model.Student]
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Column 'id' cannot be null
解决思路;
hibernate.exception.ConstraintViolationException:主键约束异常!
表student主键id不是自动增长导致!