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.Collection;
19
20 import net.sf.oness.common.model.bo.AbstractBusinessObject;
21
22 /***
23 * @hibernate.class table="barcode"
24 *
25 * @author Carlos Sanchez
26 * @version $Revision: 1.4 $
27 */
28 public class BarCode extends AbstractBusinessObject {
29
30 private String number;
31
32 private Collection products;
33
34 /***
35 * @param number
36 * The number to set.
37 */
38 public void setNumber(String number) {
39 this.number = number;
40 }
41
42 /***
43 * @hibernate.property not-null="true"
44 *
45 * @return Returns the number.
46 */
47 public String getNumber() {
48 return number;
49 }
50
51 /***
52 * @return Returns the latest version of the product.
53 */
54 public Product getProduct() {
55 return (Product) getProducts().iterator().next();
56 }
57
58 /***
59 * @param products
60 * The products to set.
61 */
62 public void setProducts(Collection products) {
63 this.products = products;
64 }
65
66 /***
67 * @hibernate.bag table="product_barcode" lazy="true" inverse="true" order-by="product_id desc"
68 * @hibernate.collection-key column="barcode_id"
69 * @hibernate.collection-many-to-many column="product_id" class="net.sf.oness.inventory.model.product.bo.Product"
70 *
71 * @return Returns the products.
72 */
73 public Collection getProducts() {
74 return products;
75 }
76
77 }