If you are using MariaDB this will work
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id", updatable = false, nullable = false)
private Long id;
For more, you can check https://thorben-janssen.com/hibernate-tips-use-auto-incremented-column-primary-key/