我想让 pgId 和 pgName 都作为复合键,其中 pgId 和 pgName 都是分配的值。我不知道我应该怎么做?在网上我得到了复合键列引用其他表的列但不是这种情况的例子?
@Entity
@Table(name = "PersonDetails")
public class PersonDetailsData implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@Basic
private int pgId;
@Basic(optional = true)
@Column(nullable = true)
private int orgId;
@Basic(optional = true)
@Column(nullable = true)
private String pgName;
public PersonWikiDetailsData() {
}
public int getPpId() {
return ppId;
}
public void setPpId(int ppId) {
this.ppId = ppId;
}
public String getSpaceName() {
return spaceName;
}
public void setSpaceName(String spaceName) {
this.spaceName = spaceName;
}
}