@Embeddable で JPA @Version アノテーションを使用すると、Updateable
クラスを指す次の例外が発生します。
org.hibernate.AnnotationException: Unable to define @Version on an embedded class
これが私のコードです:
@Embeddable
public class Updateable {
@Version
private long modcount;
private String updatedBy;
private DateTime updatedAt;
// getters & setters
}
@Entity
public class SomeEntity {
@Id
private Long id;
@Embedded
private Updateable updateAudit;
// other stuff
}
@Embeddable に @Version を含めることはできませんか、それとも Hibernate 固有のものですか?