KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > olstore > dto > OrderEntry


1 /**
2  * Copyright (c) 2004 Red Hat, Inc. All rights reserved.
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
17  * USA
18  *
19  * Component of: Red Hat Application Server
20  *
21  * Initial Developers: Aizaz Ahmed
22  * Vivek Lakshmanan
23  * Andrew Overholt
24  * Matthew Wringe
25  *
26  */

27 package olstore.dto;
28 //import olstore.entity.ItemLocal;
29
import olstore.entity.OrderLocal;
30 //import olstore.util.WebUtils;
31

32 import java.math.BigDecimal;
33
34 public class OrderEntry {
35     private Integer orderId;
36     private String userName;
37     private String itemName;
38     private Integer itemId;
39     private Integer itemQuantity;
40     private BigDecimal orderCost;
41     private String orderStatus;
42     
43     public OrderEntry(){
44         orderId = null;
45         userName = null;
46         itemName = null;
47         itemQuantity = null;
48         orderCost = null;
49         orderStatus = null;
50         itemId = null;
51     }
52     
53     public OrderEntry(OrderLocal order){
54         orderId = order.getOrderId();
55         userName = order.getUser().getUsername();
56         itemName = order.getItem().getName();
57         itemQuantity = order.getQuantity();
58         orderCost = order.getPricePaid();
59         orderStatus = order.getStatus();
60         itemId = order.getItem().getItemId();
61     }
62     
63     public String toString(){
64         return ("orderId="+ orderId + "\tuserName=" + userName + "\titemName=" + itemName + "\titemQuantity="
65                 + itemQuantity + "\torderCost=" + orderCost + "\torderStatus=" + orderStatus);
66     }
67     
68     public Integer getOrderId(){
69         return orderId ;
70     }
71     
72     public void setOrderId(Integer orderId){
73         this.orderId = orderId;
74     }
75     
76     public String getUserName () {
77         return userName ;
78     }
79     
80     public String getItemName () {
81         return itemName ;
82     }
83     
84     public Integer getItemQuantity () {
85         return itemQuantity;
86     }
87     
88     public BigDecimal getOrderCost () {
89         return orderCost;
90     }
91     
92     public String getOrderStatus () {
93         return orderStatus;
94     }
95     
96     public void setOrderStatus ( String status) {
97         orderStatus = status;
98     }
99     
100     public Integer getItemId(){
101         return itemId;
102     }
103     
104     public void setItemId(Integer itemId){
105         this.itemId = itemId;
106         
107     }
108     
109 }
110
Popular Tags