KickJava   Java API By Example, From Geeks To Geeks.

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


1 package johnmammen.betterpetshop.bo;
2
3 import java.io.Serializable JavaDoc;
4 import java.math.BigDecimal JavaDoc;
5 import org.apache.commons.lang.builder.ToStringBuilder;
6 import org.apache.tapestry.pets.domain.model.*;
7
8
9 /**
10  * @hibernate.class
11  * table="item"
12  *
13 */

14 public class Item implements Serializable JavaDoc, IItem {
15
16     /** identifier field */
17     private String JavaDoc itemid;
18
19     /** persistent field */
20     private BigDecimal JavaDoc listprice;
21
22     /** persistent field */
23     private BigDecimal JavaDoc unitcost;
24
25     /** persistent field */
26     private int qty;
27
28     /** nullable persistent field */
29     private org.apache.tapestry.pets.domain.model.IProduct product;
30
31     /** nullable persistent field */
32     private johnmammen.betterpetshop.bo.Supplier supplier;
33
34     /** full constructor */
35     public Item(String JavaDoc itemid, BigDecimal JavaDoc listprice, BigDecimal JavaDoc unitcost, int qty, org.apache.tapestry.pets.domain.model.IProduct product, johnmammen.betterpetshop.bo.Supplier supplier) {
36         this.itemid = itemid;
37         this.listprice = listprice;
38         this.unitcost = unitcost;
39         this.qty = qty;
40         this.product = product;
41         this.supplier = supplier;
42     }
43
44     /** default constructor */
45     public Item() {
46     }
47
48     /** minimal constructor */
49     public Item(String JavaDoc itemid, BigDecimal JavaDoc listprice, BigDecimal JavaDoc unitcost, int qty) {
50         this.itemid = itemid;
51         this.listprice = listprice;
52         this.unitcost = unitcost;
53         this.qty = qty;
54     }
55
56     /**
57      * @hibernate.id
58      * generator-class="assigned"
59      * type="java.lang.String"
60      * column="itemid"
61      *
62      */

63     public String JavaDoc getItemid() {
64         return this.itemid;
65     }
66
67     public void setItemid(String JavaDoc itemid) {
68         this.itemid = itemid;
69     }
70
71     /**
72      * @hibernate.property
73      * column="listprice"
74      * length="10"
75      * not-null="true"
76      *
77      */

78     public BigDecimal JavaDoc getListprice() {
79         return this.listprice;
80     }
81
82     public void setListprice(BigDecimal JavaDoc listprice) {
83         this.listprice = listprice;
84     }
85
86     /**
87      * @hibernate.property
88      * column="unitcost"
89      * length="10"
90      * not-null="true"
91      *
92      */

93     public BigDecimal JavaDoc getUnitcost() {
94         return this.unitcost;
95     }
96
97     public void setUnitcost(BigDecimal JavaDoc unitcost) {
98         this.unitcost = unitcost;
99     }
100
101     /**
102      * @hibernate.property
103      * column="qty"
104      * length="11"
105      * not-null="true"
106      *
107      */

108     public int getQty() {
109         return this.qty;
110     }
111
112     public void setQty(int qty) {
113         this.qty = qty;
114     }
115
116     /**
117      * @hibernate.many-to-one
118      * @hibernate.column name="productid"
119      *
120      */

121     public org.apache.tapestry.pets.domain.model.IProduct getProduct() {
122         return this.product;
123     }
124
125     public void setProduct(org.apache.tapestry.pets.domain.model.IProduct product) {
126         this.product = product;
127     }
128
129     /**
130      * @hibernate.many-to-one
131      * @hibernate.column name="suppid"
132      *
133      */

134     public johnmammen.betterpetshop.bo.Supplier getSupplier() {
135         return this.supplier;
136     }
137
138     public void setSupplier(johnmammen.betterpetshop.bo.Supplier supplier) {
139         this.supplier = supplier;
140     }
141
142     public String JavaDoc toString() {
143         return new ToStringBuilder(this)
144             .append("itemid", getItemid())
145             .toString();
146     }
147
148 }
149
Popular Tags