how to create a composite primary key hibernate JPA?
i try to create composite primary key in table from 2 foreign key using hibernate JPA,but gives me error.I find some solution on net but nothing The relations between tables looks like this: Table Client clientID(PK) FirstName LastName . Table CarService serviceID(PK) DescriptionOfFailure . . Table ServiceDepartment clientID(PK) serviceID(PK) price . implementation of my code looks like this: @Entity public class ServiceDepartmentBean implements ServiceDepartmentI { @EmbeddedId private ServiceDepartmentPK serviceDepartmentPK = new ServiceDepartmentPK(); @Column(name="clientID", nullable=false,