My environment : Hibernate 5
, Java 8
, Phpmyadmin in WAMP
Problem: Hibernate creates auto increment id within a table, but the
You haven't specified any generator for any of your entities. So Hibernate uses the default one for your database, which consists in using single sequence: hibernate_sequence, to generate the IDs of the entities.
Annotate your Student id field with something like
@SequenceGenerator(name = "studentGenerator", sequenceName = "STUDENT_SEQUENCE", allocationSize = 1)
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "studentGenerator")
and it will use a dedicated sequence, STUDENT_SEQUENCE, for the Student entity. Do the same (with a different generator and sequence name) for the other entities.