|
@Entity class A { @Id @GeneratedValue private long id; }
@Entity class B extends A { @Version private int modCount; }
The above code fails with this exception:
org.hibernate.AnnotationException: Unable to define/override @Version on a subclass: com.mypackage.B
Note however, that despite what Hibernate think about adding a second version attribute to the entity hierarchy, the superclass A in this example do not declare a @Version attribute. So hibernate is wrong.
|