In spring data jpa Application I created one model with @entity annotation. I am saving that model data into table. I am auto incrementing primary key. But when I am saving data into table it's not sequentially auto incrementing.
@GeneratedValue(strategy = GenerationType.AUTO)
Class file:
@Entity
@Table(name="exception")
public class Exception implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.AUTO, generator = "exception_seq_generator")
@SequenceGenerator(name = "exception_seq_generator", sequenceName = "exception_seq")
@Column(name="exception_id")
public Integer exceptionId;
@Column(name="status_code")
public Integer statusCode;
public String message;
public String status;
public String error;
//Getter and setter
Table:
Can anyone tell me why the primary key is not auto incrementing sequentially? Why it's not taking 2,3,4.....