Your database should AUTO_INCREMENT the primary key. Uou should use stratery = GenerationType.IDENTITY so that Hibernate can rely upon primary key generated by DBMS.
stratery = GenerationType.IDENTITY
@Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id;