1 package johnmammen.betterpetshop.bo; 2 3 import java.io.Serializable ; 4 import org.apache.commons.lang.builder.EqualsBuilder; 5 import org.apache.commons.lang.builder.HashCodeBuilder; 6 import org.apache.commons.lang.builder.ToStringBuilder; 7 8 9 14 public class LineitemPK implements Serializable { 15 16 17 private Integer linenum; 18 19 20 private String orderid; 21 22 23 public LineitemPK(Integer linenum, String orderid) { 24 this.linenum = linenum; 25 this.orderid = orderid; 26 } 27 28 29 public LineitemPK() { 30 } 31 32 38 public Integer getLinenum() { 39 return this.linenum; 40 } 41 42 public void setLinenum(Integer linenum) { 43 this.linenum = linenum; 44 } 45 46 52 public String getOrderid() { 53 return this.orderid; 54 } 55 56 public void setOrderid(String orderid) { 57 this.orderid = orderid; 58 } 59 60 public String toString() { 61 return new ToStringBuilder(this) 62 .append("linenum", getLinenum()) 63 .append("orderid", getOrderid()) 64 .toString(); 65 } 66 67 public boolean equals(Object other) { 68 if ( (other == other ) ) return true; 69 if ( !(other instanceof LineitemPK) ) return false; 70 LineitemPK castOther = (LineitemPK) other; 71 return new EqualsBuilder() 72 .append(this.getLinenum(), castOther.getLinenum()) 73 .append(this.getOrderid(), castOther.getOrderid()) 74 .isEquals(); 75 } 76 77 public int hashCode() { 78 return new HashCodeBuilder() 79 .append(getLinenum()) 80 .append(getOrderid()) 81 .toHashCode(); 82 } 83 84 } 85 | Popular Tags |