Given this class:
@MappedSuperclass
public abstract class AbstractEntity {
int id;
public void setId(int id) { this.id = id; }
public int getId() { return id; }
// other mappings
}
I want to define an entity:
@Entity
public class SomeEntity extends AbstractEntity {
@Override
@Id // or @OneToOne etc.
public int getId() { return id; }
}
But this fails with a "No identifier specified" (or a "Could not determine type for") error on SomeEntity. If I remove the getter from the superclass it works. Can't I do this override strategy? Why not, or if yes - how?
Adding
@AttributeOverride(name = "id", column = @Column(name = "ID"))
to the subclass does not change the error.