@AllArgsConstructor
@NoArgsConstructor
@Getter
@Setter
@SuperBuilder
@Inheritance(strategy = InheritanceType.JOINED)
@Entity
public class Person {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
private String dataType;
private String firstName;
private String lastName;
@Column(unique = true)
private String identifier;
private double height;
private double weight;
private String email;
}
Hello , when I hit HTTP POST and occur ConstraintValidationException database increase ID +1
example I added first user ID 1
I try to add user two and occur exception – increased ID and user not added
then I try to add user three and he has ID 3 instead of ID 2