내 개체를 초기화 할 때 GeneratedValue 주석을 사용하는 방법에 대한 모든 문서를 찾을 수없는 것 같습니다. 여기@GeneratedValue 주석, 생성자 값
내 개체 클래스 내 id 필드, 나는 두 개의 다른 분야 나는
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Basic(optional = false)
@NotNull
@Column(name = "ID")
private BigDecimal id;
내 생성자
public Pothole() {
}
public Pothole(BigDecimal id) {
this.id = id;
}
public Pothole(BigDecimal id, byte[] image, Date pdate) {
this.id = id;
this.image = image;
this.pdate = pdate;
}
내 ID 필드에 무엇을 사용합니까을 떠난 한 된 ?? 주어진 개체의 id
데이터베이스에 의해 평가 될 것이다 (즉, insert
문을 수행) 나는 Hibernate가 데이터베이스에서 엔티티를 지속 할 때 빈
Pothole entity = new Pothole(???,decodedBytes, date);