I were facing this issue too when saving or updating entity in database, finally get rid of it using two ways:
- Either remove the @GeneratedValue(strategy = GenerationType.AUTO) or
- Don't send primary key value from webrequest using Post method from postman like application, because using if you are using @GeneratedValue(strategy = GenerationType.AUTO) it will automatically store primary key.