I have my hibernate configured as follows:
Entity
@Table (name = "statuspaatelling")
public class StatusPaaTelling {
private Long statusPaaTellingId;
@Id
@Column(name = "statusPaaTellingID")
@GeneratedValue(strategy = GenerationType.AUTO)
public Long getStatusPaaTellingId() {
return statusPaaTellingId;
}
When I was creating new elements it worked perfectly, but suddenly now it creates values that already exist. And I cant create new elements since i get duplicate entries for my Primary key. I am using a MySQL database.
Duplicate entry '3155220' for key 'PRIMARY'
Error Code: 1062
Call: INSERT INTO statuspaatelling (statusPaaTellingID, something) VALUES(?, ?)
I think it might first happened when i imported a dump of the database and switched to using that. I've also tried switching back with no luck, but they have the exact same setup so I should not matter. Anyone has any ideas why the GeneratedValue suddenly didn't work?