@IDClass(EmployeePK.class)
@Entity(name="EMPLOYEE")
public class Employee implements Serializable{
@ID
private String firstName;
@ID
private String lastName;
private String qualification;
private String speciality;
// getters and setters go here
}
Now create a class called EmployeePK in the same package as Employee class with attributes firstName and lastName.
public class EmployeePK implements Serializable{
private String firstName;
private String lastName;
// getters and setters for firstName and lastName go here...
}
No comments:
Post a Comment