My entity id is generated, and it was working fine when I use DAO instead of Spring data JPA.
@Id
@Column(name = TABLE_COLUM_NAME_ID)
@GeneratedValue
private
repository.saveAndFlush();
method:
MyObject savedObject= repository.saveAndFlush(newObject);
@GeneratedValue(strategy = GenerationType.AUTO)
) to the related field(id
): @Id @Column(name = "id") @GeneratedValue(strategy = GenerationType.AUTO) public long getId() { return id; }