解决办法: @GeneratedValue(strategy = GenerationType.IDENTITY) 如图所示: 转载于:https://www.cnblogs.com/guo-xu/p/10691111.html