KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > test > cid > Customer


1 //$Id: Customer.java,v 1.2 2004/11/25 14:37:00 steveebersole Exp $
2
package org.hibernate.test.cid;
3
4 import java.util.ArrayList JavaDoc;
5 import java.util.List JavaDoc;
6 import java.util.GregorianCalendar JavaDoc;
7 import java.math.BigDecimal JavaDoc;
8
9 /**
10  * @author Gavin King
11  */

12 public class Customer {
13     private String JavaDoc customerId;
14     private String JavaDoc name;
15     private String JavaDoc address;
16     private List JavaDoc orders = new ArrayList JavaDoc();
17     /**
18      * @return Returns the address.
19      */

20     public String JavaDoc getAddress() {
21         return address;
22     }
23     /**
24      * @param address The address to set.
25      */

26     public void setAddress(String JavaDoc address) {
27         this.address = address;
28     }
29     /**
30      * @return Returns the customerId.
31      */

32     public String JavaDoc getCustomerId() {
33         return customerId;
34     }
35     /**
36      * @param customerId The customerId to set.
37      */

38     public void setCustomerId(String JavaDoc customerId) {
39         this.customerId = customerId;
40     }
41     /**
42      * @return Returns the name.
43      */

44     public String JavaDoc getName() {
45         return name;
46     }
47     /**
48      * @param name The name to set.
49      */

50     public void setName(String JavaDoc name) {
51         this.name = name;
52     }
53     /**
54      * @return Returns the orders.
55      */

56     public List JavaDoc getOrders() {
57         return orders;
58     }
59     /**
60      * @param orders The orders to set.
61      */

62     public void setOrders(List JavaDoc orders) {
63         this.orders = orders;
64     }
65
66     public Order generateNewOrder(BigDecimal JavaDoc total) {
67         Order order = new Order(this);
68         order.setOrderDate( new GregorianCalendar JavaDoc() );
69         order.setTotal( total );
70
71         return order;
72     }
73 }
74
Popular Tags