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 LinePK implements Serializable { 31 32 33 @Column(name = "STACKTRACE_ID", nullable = false) 34 private int stacktraceId; 35 @Column(name = "METHOD_ID", nullable = false) 36 private int methodId; 37 @Column(name = "LINENUMBER", nullable = false) 38 private int linenumber; 39 @Column(name = "LINE_ORDER", nullable = false) 40 private int lineOrder; 41 42 43 public LinePK() { 44 } 45 46 public LinePK(int stacktraceId, int methodId, int linenumber, int lineOrder) { 47 this.stacktraceId = stacktraceId; 48 this.methodId = methodId; 49 this.linenumber = linenumber; 50 this.lineOrder = lineOrder; 51 } 52 53 public int getStacktraceId() { 54 return stacktraceId; 55 } 56 57 public void setStacktraceId(int stacktraceId) { 58 this.stacktraceId = stacktraceId; 59 } 60 61 public int getMethodId() { 62 return methodId; 63 } 64 65 public void setMethodId(int methodId) { 66 this.methodId = methodId; 67 } 68 69 public int getLinenumber() { 70 return linenumber; 71 } 72 73 public void setLinenumber(int linenumber) { 74 this.linenumber = linenumber; 75 } 76 77 public int getLineOrder() { 78 return lineOrder; 79 } 80 81 public void setLineOrder(int lineOrder) { 82 this.lineOrder = lineOrder; 83 } 84 85 @Override 86 public int hashCode() { 87 int hash = 0; 88 89 hash += (int) stacktraceId; 90 hash += (int) methodId; 91 hash += (int) linenumber; 92 hash += (int) lineOrder; 93 return hash; 94 } 95 96 @Override 97 public boolean equals(Object object) { 98 if (!(object instanceof LinePK)) { 99 return false; 100 } 101 LinePK other = (LinePK) object; 102 103 if (this.stacktraceId != other.stacktraceId) 104 return false; 105 if (this.methodId != other.methodId) 106 return false; 107 if (this.linenumber != other.linenumber) 108 return false; 109 if (this.lineOrder != other.lineOrder) 110 return false; 111 return true; 112 } 113 114 @Override 115 public String toString() { 116 return "test.LinePK[stacktraceId=" + stacktraceId + ", methodId=" + 117 methodId + ", linenumber=" + linenumber + ", lineOrder=" + 118 lineOrder + "]"; 119 } 120 121 } 122 | Popular Tags |