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;