我有2个课程police
和policeArchive
每个人都拥有自己的ID但我无法将2个ID添加到继承实体:
@Entity
@Table
@Inheritance(strategy = InheritanceType.JOINED)
public class Police implements Serializable{
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(nullable = false)
private Long idpolice;
@Column(nullable = false)
private String name;
@Column(nullable = false)
private char nature;
..
}
@Entity
@Table
@primarykeyjoincolumn(name="idpolice")
public class PoliceArchive extends Police implements Serializable{
@Column(nullable = false)
private String idArchive;
@Column(nullable = false)
private String applicant;
@Column(nullable = false)
private Date modidficationDate;
..
}