KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > johnmammen > betterpetshop > bo > LineitemPK


1 package johnmammen.betterpetshop.bo;
2
3 import java.io.Serializable JavaDoc;
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 /**
10  * @hibernate.id
11  * generator-class="assigned"
12  *
13 */

14 public class LineitemPK implements Serializable JavaDoc {
15
16     /** identifier field */
17     private Integer JavaDoc linenum;
18
19     /** identifier field */
20     private String JavaDoc orderid;
21
22     /** full constructor */
23     public LineitemPK(Integer JavaDoc linenum, String JavaDoc orderid) {
24         this.linenum = linenum;
25         this.orderid = orderid;
26     }
27
28     /** default constructor */
29     public LineitemPK() {
30     }
31
32     /**
33      * @hibernate.property
34      * column="linenum"
35      * length="11"
36      *
37      */

38     public Integer JavaDoc getLinenum() {
39         return this.linenum;
40     }
41
42     public void setLinenum(Integer JavaDoc linenum) {
43         this.linenum = linenum;
44     }
45
46     /**
47      * @hibernate.property
48      * column="orderid"
49      * length="36"
50      *
51      */

52     public String JavaDoc getOrderid() {
53         return this.orderid;
54     }
55
56     public void setOrderid(String JavaDoc orderid) {
57         this.orderid = orderid;
58     }
59
60     public String JavaDoc toString() {
61         return new ToStringBuilder(this)
62             .append("linenum", getLinenum())
63             .append("orderid", getOrderid())
64             .toString();
65     }
66
67     public boolean equals(Object JavaDoc 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