当我在 @Embeddable 中使用 JPA @Version 注释时,我得到以下指向我的Updateable类的异常:
org.hibernate.AnnotationException: Unable to define @Version on an embedded class
Run Code Online (Sandbox Code Playgroud)
这是我的代码:
org.hibernate.AnnotationException: Unable to define @Version on an embedded class
Run Code Online (Sandbox Code Playgroud)
@Embeddable
public class Updateable {
@Version
private long modcount;
private String updatedBy;
private DateTime updatedAt;
// getters & setters
}
Run Code Online (Sandbox Code Playgroud)
在@Embeddable 中不可能有@Version,还是这个Hibernate 特定的?