我通过以下方式使用@MappedSuperclass
注释:
@MappedSuperclass
public abstract class Recipient {
@Id
@Column(name = "id")
private int id;
@Column(name = "email")
private String email;
//GET, SET
}
我还有两个实体classe,继承自一个:
public class Player extends Recipient{
//FIELD, GET, SET
}
和
public class Partner extends Recipient{
//FIELD, GET, SET
}
private int id
中提到的class Player
具有附加属性:
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
private int id;
是否可以指定?我们可以使用注释@AttributeOverride
覆盖属性,但是要添加一个?