import javax.persistence.GenerationType; @Id @GeneratedValue(strategy = GenerationType.AUTO) private long id;