In this code I need the id to be the primary key and also it must be incremented.
is getter and setter required for id ?
@Entity
public class Contact {
@Id
private Integer id;
private String firstName;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}