KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > test > hibernate > Order


1 package test.hibernate;
2
3 import java.util.Calendar JavaDoc;
4 import java.util.List JavaDoc;
5
6 /**
7  * @author Administrator
8  *
9  * @hibernate.jcs-cache
10  * usage="read-write"
11  * @hibernate.class
12  * table="ORDERS"
13  * polymorphism="explicit"
14  * mutable="false"
15  */

16 public class Order extends Persistent implements Updateable {
17     
18     private List JavaDoc items;
19     private Human customer;
20     private Calendar JavaDoc date;
21     private String JavaDoc updateComment;
22
23     /**
24      * Constructor for Order.
25      */

26     public Order() {
27         super();
28     }
29
30     /**
31      * @hibernate.list
32      * lazy="true"
33      * inverse="true"
34      * cascade="all"
35      * @hibernate.jcs-cache
36      * usage="read-write"
37      * @hibernate.collection-key
38      * column="ORDER_ID"
39      * @hibernate.collection-index
40      * column="ORDER_POS"
41      * @hibernate.collection-one-to-many
42      * class="test.hibernate.LineItem"
43      * @return List
44      */

45     public List JavaDoc getItems() {
46         return items;
47     }
48
49     /**
50      * Sets the items.
51      * @param items The items to set
52      */

53     public void setItems(List JavaDoc items) {
54         this.items = items;
55     }
56
57     /**
58      * @hibernate.property
59      * type="calendar_date"
60      * Returns the date.
61      * @return Calendar
62      */

63     public Calendar JavaDoc getDate() {
64         return date;
65     }
66
67     /**
68      * Sets the date.
69      * @param date The date to set
70      */

71     public void setDate(Calendar JavaDoc date) {
72         this.date = date;
73     }
74
75     /**
76      * @hibernate.many-to-one
77      * column="CUSTOMER_ID"
78      * not-null="true"
79      * @return Human
80      */

81     public Human getCustomer() {
82         return customer;
83     }
84
85     /**
86      * Sets the customer.
87      * @param customer The customer to set
88      */

89     public void setCustomer(Human customer) {
90         this.customer = customer;
91     }
92
93     public String JavaDoc getUpdateComment() {
94         return updateComment;
95     }
96
97     public void setUpdateComment(String JavaDoc string) {
98         updateComment = string;
99     }
100
101 }
102
Popular Tags