org.hibernate.HibernateException: The database returned no natively generated identity value
problem
使用hibernate新增数据报错
org.hibernate.HibernateException: The database returned no natively generated identity value
reason
table的字段id不是自增特性
solution
设置id为自增特性
-- 将id字段设置为主键,不为空,自增即可
alter table User modify id int(11) not Null auto_increment primary key;