We have a base class (MappedSuperclass) containing a Version field which is inherited by all our Entities. But now we want some of our classes to be non-versioned, so what is the best way to over-ride the version field as a Basic Property?
Example:
@MappedSuperclass
public class Base {
@Version
@Column(name = "VERSION", columnDefinition = "bigint default -1")
public long getVersion() {
return version;
}
// other base properties
}
Entity A, we don’t want to it to be versioned
@Entity
public class EntityA extends Base {
// extra fields for EntityA
}