KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > test > filter > Order


1 // $Id: Order.java,v 1.2 2004/08/10 05:19:46 steveebersole Exp $
2
package org.hibernate.test.filter;
3
4 import java.util.Date JavaDoc;
5 import java.util.List JavaDoc;
6 import java.util.ArrayList JavaDoc;
7
8 /**
9  * @author Steve Ebersole
10  */

11 public class Order {
12     private Long JavaDoc id;
13     private String JavaDoc region;
14     private Date JavaDoc placementDate;
15     private Date JavaDoc fulfillmentDate;
16     private Salesperson salesperson;
17     private String JavaDoc buyer;
18     private List JavaDoc lineItems = new ArrayList JavaDoc();
19
20     public Long JavaDoc getId() {
21         return id;
22     }
23
24     public void setId(Long JavaDoc id) {
25         this.id = id;
26     }
27
28     public String JavaDoc getRegion() {
29         return region;
30     }
31
32     public void setRegion(String JavaDoc region) {
33         this.region = region;
34     }
35
36     public Date JavaDoc getPlacementDate() {
37         return placementDate;
38     }
39
40     public void setPlacementDate(Date JavaDoc placementDate) {
41         this.placementDate = placementDate;
42     }
43
44     public Date JavaDoc getFulfillmentDate() {
45         return fulfillmentDate;
46     }
47
48     public void setFulfillmentDate(Date JavaDoc fulfillmentDate) {
49         this.fulfillmentDate = fulfillmentDate;
50     }
51
52     public Salesperson getSalesperson() {
53         return salesperson;
54     }
55
56     public void setSalesperson(Salesperson salesperson) {
57         this.salesperson = salesperson;
58     }
59
60     public String JavaDoc getBuyer() {
61         return buyer;
62     }
63
64     public void setBuyer(String JavaDoc buyer) {
65         this.buyer = buyer;
66     }
67
68     public List JavaDoc getLineItems() {
69         return lineItems;
70     }
71
72     protected void setLineItems(List JavaDoc lineItems) {
73         this.lineItems = lineItems;
74     }
75
76     public LineItem addLineItem(Product product, long quantity) {
77         return LineItem.generate(this, getLineItems().size(), product, quantity);
78     }
79
80     public void removeLineItem(LineItem item) {
81         removeLineItem( item.getSequence() );
82     }
83
84     public void removeLineItem(int sequence) {
85         getLineItems().remove(sequence);
86     }
87 }
88
Popular Tags