I have two columns which will use @GeneratedValues, but when I am putting them like this it is giving error; " Exception Description: Class [class Testing] has two @GeneratedValues: for fields [Testing.SEQ_NO] and [Testing.ID]. Only one is allowed. "
@Table(name = "TABLE1")
@Entity
public class Testing{
@GeneratedValue(strategy=GenerationType.AUTO)
@Id
private Long id;
@Column(name = "LINKAGE_ID")
private int linkageId;
@Column(name = "TRANSFER_ID")
private int transferId;
@Column(name = "STATUS")
private String status;
@Column(name = "COMMENTS")
private String comments;
@GeneratedValue(strategy=GenerationType.SEQUENCE,generator="SEQ")
@SequenceGenerator(name="SEQ",sequenceName="SEQ", allocationSize=1)
@Column(name = "SEQ_NO")
private int seqNo;
**I have also created a simple sequence in Db using this:**
CREATE SEQUENCE SEQ START WITH 1