|
When you add following entity to a MySQL database:
@Entity
public class Person {
@Id
@GeneratedValue
private long id;
private String name;
}
Hibernate 4 sends following correct SQL insert statement to the database
insert into Person(name) values (?)
This insert statement does not provide a value for the field id: this field is correctly (based on @GeneratedValue) presumed to be autonumer.
Hibernate 5 sends following SQL statement to the database
select next_val as id_val from hibernate_sequence for update
which gives an error, as the table hibernate_sequence does not exist
|