KickJava   Java API By Example, From Geeks To Geeks.

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


1 // $Id: LineItem.java,v 1.1 2004/07/20 04:07:40 steveebersole Exp $
2
package org.hibernate.test.filter;
3
4 /**
5  * Implementation of LineItem.
6  *
7  * @author Steve
8  */

9 public class LineItem {
10     private Long JavaDoc id;
11     private Order order;
12     private int sequence;
13     private Product product;
14     private long quantity;
15
16     /*package*/ LineItem() {}
17
18     public static LineItem generate(Order order, int sequence, Product product, long quantity) {
19         LineItem item = new LineItem();
20         item.order = order;
21         item.sequence = sequence;
22         item.product = product;
23         item.quantity = quantity;
24         item.order.getLineItems().add(sequence, item);
25         return item;
26     }
27
28     public Long JavaDoc getId() {
29         return id;
30     }
31
32     public void setId(Long JavaDoc id) {
33         this.id = id;
34     }
35
36     public Order getOrder() {
37         return order;
38     }
39
40     public void setOrder(Order order) {
41         this.order = order;
42     }
43
44     public int getSequence() {
45         return sequence;
46     }
47
48     public void setSequence(int sequence) {
49         this.sequence = sequence;
50     }
51
52     public Product getProduct() {
53         return product;
54     }
55
56     public void setProduct(Product product) {
57         this.product = product;
58     }
59
60     public long getQuantity() {
61         return quantity;
62     }
63
64     public void setQuantity(long quantity) {
65         this.quantity = quantity;
66     }
67 }
68
Popular Tags