how to make the two class fields(not referring any other table) as composite key in hibernate?
- by M Sach
i want to make pgId and pgName both as composite key where both pgId anf pgName are assgined values. i am not sure how should i go about it?
on net i get examples where composite key column refering to column of some other table but not this kind of scenario?
@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;
}
}