79663694

Date: 2025-06-12 14:29:27
Score: 1
Natty:
Report link

You're getting the error because your id column in MySQL isn't set as AUTO_INCREMENT. Even though you use @GeneratedValue, the DB itself must be configured to auto-increment. let Hibernate recreate the table with:

spring.jpa.hibernate.ddl-auto=update

or you can alter table to make it support auto-increment :

ALTER TABLE role MODIFY id BIGINT AUTO_INCREMENT;

Reasons:
  • Has code block (-0.5):
  • User mentioned (1): @GeneratedValue
  • Low reputation (0.5):
Posted by: gdoura mohamed