JPA中MYSQL生成id,若是使用:mysql
@Id @GeneratedValue(strategy = GenerationType.AUTO) private int id;
那麼在id的生成中,mysql就會使用sequence,會報一個hibernate_sequence表的錯誤。 could not read a hi value - you need to populate the table: hibernate_sequencesql
解決方法:hibernate
@Id @GeneratedValue(strategy = GenerationType.IDENTITY) private int id;