|
if you have a simple base entity, e.g.
@MappedSuperclass
public abstract class DistributedEntity implements Serializable {
private String id;
private Long version;
@Id
public String getId() {
return id;
}
public void setId(final String id) {
this.id = id;
}
@Version
public Long getVersion() {
return version;
}
public void setVersion(final Long version) {
this.version = version;
}
}
and you subclass this entity more than once, JPA EntityType's (or ManagedType's) getSingularAttributes() returns the version attribute with isVersion set to false.
I've created a sample project with sample entities and a testcase to show the problem in the attachment. Just call "gradlew clean build".
|