I'm using @MappedSuperclass
annotation in the following way:
@MappedSuperclass
public abstract class Recipient {
@Id
@Column(name = "id")
private int id;
@Column(name = "email")
private String email;
//GET, SET
}
I also have two entity classe, inherited from one:
public class Player extends Recipient{
//FIELD, GET, SET
}
and
public class Partner extends Recipient{
//FIELD, GET, SET
}
The thing is private int id
filed in the class Player
has an additional attribute:
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
private int id;
Is it possible to specify that? We can override attribute with annotation @AttributeOverride
, but what about to add one?