package pe.ejb.ejb30.entity.ejb; import java.io.Serializable; import javax.persistence.*; import java.util.*; import javax.persistence.Temporal; import javax.persistence.TemporalType; @Embeddable public class ProjectPK implements Serializable{ @Column(name="PROJNAME") String projname; @Column(name="PROJDATE") @Temporal(TemporalType.DATE) java.util.Date projdate; public ProjectPK(String pname, Date pdate) { this.projname = pname; this.projdate = pdate; } public ProjectPK() {} public String getPname() { return projname; } public void setPname(String pname) { this.projname = pname; } public java.util.Date getProjdate() { return projdate; } public void setProjdate(java.util.Date pdate) { this.projdate = pdate; } public boolean equals(Object obj) { if (obj instanceof ProjectPK) { return (projname.equals(((ProjectPK)obj).projname) && projdate == (((ProjectPK)obj).projdate)); } return false; } public int hashCode() { return projname.concat(projdate.toString()).hashCode(); } }