原因是实体类设置为strategy = GenerationType.AUTO自增长,数据库表中的字段去没有设置为自增长的,需要修改为id int(11) NOT NULL auto_increment.
转载于:https://www.cnblogs.com/Neil223/p/Hibernate%e6%b3%a8%e8%a7%a3.html
原因是实体类设置为strategy = GenerationType.AUTO自增长,数据库表中的字段去没有设置为自增长的,需要修改为id int(11) NOT NULL auto_increment.
转载于:https://www.cnblogs.com/Neil223/p/Hibernate%e6%b3%a8%e8%a7%a3.html