| What is "AnnotateOverwrite"? Do you mean JPA's AttributeOverride? What is the exception you get? One work around should be to put @NaturalId on the MappedSuperclass. There are tests for that specifically. I am adding one that tries this approach. I'm thinking we probably should support this, although IMO I think it should only work in conjunction with @AttributeOverride. This would be more consistent with how annotation handling is defined to work and how we currently define as well.
@Entity
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
@NaturalIdCache
public class MyEntity extends BasicEntity {
private String name;
@AttributeOverride
@NaturalId
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
|