1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package net.sf.oness.inventory.model.product.bo;
17
18 import java.util.ArrayList;
19 import java.util.Collection;
20 import java.util.Iterator;
21
22 import net.sf.oness.common.model.bo.AbstractBusinessObject;
23
24 /***
25 * @hibernate.class table="product"
26 *
27 * @author Carlos Sanchez
28 * @version $Revision: 1.7 $
29 */
30 public class Product extends AbstractBusinessObject {
31
32 private Collection models = new ArrayList();
33
34 private String stockKeepingUnit;
35
36 private Collection barCodes;
37
38 private Size size;
39
40 private Color color;
41
42 private Collection prices;
43
44 private Collection stocks;
45
46 /***
47 * @param models
48 * The models to set.
49 */
50 public void setModels(Collection models) {
51 this.models = models;
52 }
53
54 /***
55 * @hibernate.bag table="model_product" inverse="true" lazy="true" order-by="model_id desc"
56 * @hibernate.collection-key column="product_id"
57 * @hibernate.collection-many-to-many column="model_id" class="net.sf.oness.inventory.model.product.bo.Model"
58 *
59 * @return Returns the models.
60 */
61 public Collection getModels() {
62 return models;
63 }
64
65 /***
66 * @return Returns the the latest version of model.
67 */
68 public Model getModel() {
69 Iterator iter = getModels().iterator();
70 return iter.hasNext() ? (Model) iter.next() : null;
71 }
72
73 /***
74 * @param stockKeepingUnit
75 * The stockKeepingUnit to set.
76 */
77 public void setStockKeepingUnit(String stockKeepingUnit) {
78 this.stockKeepingUnit = stockKeepingUnit;
79 }
80
81 /***
82 * @hibernate.property
83 *
84 * @return Returns the stockKeepingUnit.
85 */
86 public String getStockKeepingUnit() {
87 return stockKeepingUnit;
88 }
89
90 /***
91 * @param barCodes
92 * The barCodes to set.
93 */
94 public void setBarCodes(Collection barCodes) {
95 this.barCodes = barCodes;
96 }
97
98 /***
99 * @hibernate.bag table="product_barcode" lazy="true"
100 * @hibernate.collection-key column="product_id"
101 * @hibernate.collection-many-to-many column="barcode_id" class="net.sf.oness.inventory.model.product.bo.BarCode"
102 *
103 * @return <code>Collection</code> of <code>BarCode</code> objects
104 */
105 public Collection getBarCodes() {
106 return barCodes;
107 }
108
109 /***
110 * @param size
111 * The size to set.
112 */
113 public void setSize(Size size) {
114 this.size = size;
115 }
116
117 /***
118 * @hibernate.many-to-one
119 *
120 * @return Returns the size.
121 */
122 public Size getSize() {
123 return size;
124 }
125
126 /***
127 * @param color
128 * The color to set.
129 */
130 public void setColor(Color color) {
131 this.color = color;
132 }
133
134 /***
135 * @hibernate.many-to-one
136 *
137 * @return Returns the color.
138 */
139 public Color getColor() {
140 return color;
141 }
142
143 /***
144 * @param prices
145 * The prices to set.
146 */
147 public void setPrices(Collection prices) {
148 this.prices = prices;
149 }
150
151 /***
152 * @hibernate.bag table="product_price" lazy="true" inverse="true"
153 * @hibernate.collection-key column="product_id"
154 * @hibernate.collection-many-to-many column="price_id" class="net.sf.oness.inventory.model.product.bo.Price"
155 *
156 * @return Returns the prices.
157 */
158 public Collection getPrices() {
159 return prices;
160 }
161
162 /***
163 * @param stocks
164 * The stocks to set.
165 */
166 public void setStocks(Collection stocks) {
167 this.stocks = stocks;
168 }
169
170 /***
171 * @hibernate.bag table="product_stock" lazy="true"
172 * @hibernate.collection-key column="product_id"
173 * @hibernate.collection-many-to-many column="stock_id" class="net.sf.oness.inventory.model.warehouse.bo.Stock"
174 *
175 * @return Returns the stocks.
176 */
177 public Collection getStocks() {
178 return stocks;
179 }
180
181 }