1 19 package org.netbeans.modules.exceptions.entity; 20 21 import java.io.Serializable ; 22 import javax.persistence.Column; 23 import javax.persistence.Embeddable; 24 25 29 @Embeddable 30 public class CommentPK implements Serializable { 31 32 33 @Column(name = "ID", nullable = false) 34 private int id; 35 @Column(name = "ISSUE_ID", nullable = false) 36 private int issueId; 37 38 39 public CommentPK() { 40 } 41 42 public CommentPK(int id, int issueId) { 43 this.id = id; 44 this.issueId = issueId; 45 } 46 47 public int getId() { 48 return id; 49 } 50 51 public void setId(int id) { 52 this.id = id; 53 } 54 55 public int getIssueId() { 56 return issueId; 57 } 58 59 public void setIssueId(int issueId) { 60 this.issueId = issueId; 61 } 62 63 @Override 64 public int hashCode() { 65 int hash = 0; 66 67 hash += (int) id; 68 hash += (int) issueId; 69 return hash; 70 } 71 72 @Override 73 public boolean equals(Object object) { 74 if (!(object instanceof CommentPK)) { 75 return false; 76 } 77 CommentPK other = (CommentPK) object; 78 79 if (this.id != other.id) 80 return false; 81 if (this.issueId != other.issueId) 82 return false; 83 return true; 84 } 85 86 @Override 87 public String toString() { 88 return "test.CommentPK[id=" + id + ", issueId=" + issueId + "]"; 89 } 90 91 } 92 | Popular Tags |