1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package net.sf.oness.order.model.bo;
17
18 import java.math.BigDecimal;
19 import java.util.Collection;
20 import java.util.Iterator;
21
22 /***
23 * @hibernate.class table="invoiceitem"
24 *
25 * @author Carlos Sanchez
26 * @version $Revision: 1.4 $
27 */
28 public class InvoiceItem extends Item {
29
30 private BigDecimal price;
31
32 private Collection invoices;
33
34 /***
35 * @param price
36 * The price to set.
37 */
38 public void setPrice(BigDecimal price) {
39 this.price = price;
40 }
41
42 /***
43 * @hibernate.property length="2"
44 *
45 * @return Returns the price.
46 */
47 public BigDecimal getPrice() {
48 return price;
49 }
50
51 /***
52 * @param invoices The invoices to set.
53 */
54 public void setInvoices(Collection invoices) {
55 this.invoices = invoices;
56 }
57
58 /***
59 * @hibernate.bag table="invoice_invoiceitem" lazy="true" order-by="invoice_id desc"
60 * @hibernate.collection-key column="invoiceitem_id"
61 * @hibernate.collection-many-to-many column="invoice_id" class="net.sf.oness.order.model.bo.Invoice"
62 *
63 * @return Returns the invoices.
64 */
65 public Collection getInvoices() {
66 return invoices;
67 }
68
69 /***
70 * @return Returns the the latest version of the invoice.
71 */
72 public Invoice getInvoice() {
73 Iterator iter = getInvoices().iterator();
74 return iter.hasNext() ? (Invoice) iter.next() : null;
75 }
76
77 }