KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > test > hibernate > LineItem


1 package test.hibernate;
2 /**
3  * @hibernate.class
4  * table="ITEMS"
5  * mutable="false"
6  * schema="SHOP"
7  * proxy="LineItem"
8  *
9  * @author Administrator
10  *
11  */

12 public class LineItem extends Persistent {
13     
14     private Order order;
15     private Product product;
16     private int quantity;
17
18     /**
19      * Constructor for LineItem.
20      */

21     public LineItem() {
22         super();
23     }
24
25     /**
26      * @hibernate.many-to-one
27      * outer-join="true"
28      * cascade="save-update"
29      * column="ORDER_ID"
30      * not-null="true"
31      * sql-type="BIGINT"
32      * @return Order
33      */

34     public Order getOrder() {
35         return order;
36     }
37
38     /**
39      * Sets the order.
40      * @param order The order to set
41      */

42     public void setOrder(Order order) {
43         this.order = order;
44     }
45
46     /**
47      * @hibernate.property
48      * column="AMOUNT"
49      * not-null="true"
50      * unique="false"
51      * Returns the quantity.
52      * @return int
53      */

54     public int getQuantity() {
55         return quantity;
56     }
57
58     /**
59      * Sets the quantity.
60      * @param quantity The quantity to set
61      */

62     public void setQuantity(int quantity) {
63         this.quantity = quantity;
64     }
65
66     /**
67      * @hibernate.many-to-one
68      * column="PRODUCT_ID"
69      * outer-join="true"
70      * not-null="true"
71      * @return Product
72      */

73     public Product getProduct() {
74         return product;
75     }
76
77     /**
78      * Sets the product.
79      * @param product The product to set
80      */

81     public void setProduct(Product product) {
82         this.product = product;
83     }
84
85 }
86
Popular Tags