@Entity
public class Review {
protected Long id;
private Rating rating;
private ZonedDateTime postedAt;
private int version;
@Id
public Long getId() {
return id;
}
Override the default access strategy
하나의 엔티티에서 두개의 전략을 섞어서 사용하고 싶다면 @Access 어노테이션을 이용하기
@Entity
public class Review {
protected Long id;
private Rating rating;
private ZonedDateTime postedAt;
@Version
@Access(AccessType.FIELD)
private int version;
@Id
public Long getId() {
return id;
}
version attribute에 대해 property-based → field-based로 변경한 것임