| 26629 |
tejbeer |
1 |
package com.spice.profitmandi.dao.entity.fofo;
|
|
|
2 |
|
|
|
3 |
import java.io.Serializable;
|
|
|
4 |
import java.time.LocalDateTime;
|
|
|
5 |
|
|
|
6 |
import javax.persistence.Column;
|
|
|
7 |
import javax.persistence.Convert;
|
|
|
8 |
import javax.persistence.Entity;
|
|
|
9 |
import javax.persistence.GeneratedValue;
|
|
|
10 |
import javax.persistence.GenerationType;
|
|
|
11 |
import javax.persistence.Id;
|
|
|
12 |
import javax.persistence.Table;
|
| 26817 |
amit.gupta |
13 |
import javax.persistence.Transient;
|
| 26629 |
tejbeer |
14 |
import javax.persistence.UniqueConstraint;
|
|
|
15 |
|
|
|
16 |
import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;
|
|
|
17 |
|
|
|
18 |
@Entity
|
|
|
19 |
@Table(name = "fofo.pending_order_item", schema = "fofo", uniqueConstraints = {
|
|
|
20 |
@UniqueConstraint(name = "UK_ORDER_ID_AND_ITEM_ID", columnNames = { "order_id", "item_id" }) })
|
|
|
21 |
public class PendingOrderItem implements Serializable {
|
|
|
22 |
|
| 26817 |
amit.gupta |
23 |
public String getItemName() {
|
|
|
24 |
return itemName;
|
|
|
25 |
}
|
|
|
26 |
|
|
|
27 |
public void setItemName(String itemName) {
|
|
|
28 |
this.itemName = itemName;
|
|
|
29 |
}
|
|
|
30 |
|
| 26629 |
tejbeer |
31 |
private static final long serialVersionUID = 1L;
|
|
|
32 |
|
|
|
33 |
@Id
|
|
|
34 |
@Column(name = "id")
|
|
|
35 |
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
|
|
36 |
private int id;
|
|
|
37 |
|
|
|
38 |
@Column(name = "order_id")
|
|
|
39 |
private int orderId;
|
|
|
40 |
|
|
|
41 |
@Column(name = "item_id")
|
|
|
42 |
private int itemId;
|
| 26817 |
amit.gupta |
43 |
|
|
|
44 |
@Transient
|
|
|
45 |
private String itemName;
|
| 26924 |
amit.gupta |
46 |
|
|
|
47 |
@Transient
|
|
|
48 |
private String imgUrl;
|
|
|
49 |
|
|
|
50 |
|
| 26629 |
tejbeer |
51 |
|
| 26924 |
amit.gupta |
52 |
public String getImgUrl() {
|
|
|
53 |
return imgUrl;
|
|
|
54 |
}
|
|
|
55 |
|
|
|
56 |
public void setImgUrl(String imgUrl) {
|
|
|
57 |
this.imgUrl = imgUrl;
|
|
|
58 |
}
|
|
|
59 |
|
| 26629 |
tejbeer |
60 |
@Column(name = "quantity")
|
|
|
61 |
private int quantity;
|
|
|
62 |
|
|
|
63 |
@Column(name = "selling_price")
|
|
|
64 |
private float sellingPrice;
|
|
|
65 |
|
| 26721 |
tejbeer |
66 |
@Column(name = "status")
|
|
|
67 |
private String status;
|
| 26924 |
amit.gupta |
68 |
|
|
|
69 |
@Column(name = "scheduled_delivery_time")
|
|
|
70 |
private LocalDateTime scheduledDeliveryTime;
|
| 26721 |
tejbeer |
71 |
|
| 26629 |
tejbeer |
72 |
@Convert(converter = LocalDateTimeAttributeConverter.class)
|
|
|
73 |
@Column(name = "create_timestamp")
|
|
|
74 |
private LocalDateTime createTimestamp = LocalDateTime.now();
|
|
|
75 |
|
| 26721 |
tejbeer |
76 |
public String getStatus() {
|
|
|
77 |
return status;
|
|
|
78 |
}
|
| 26924 |
amit.gupta |
79 |
|
|
|
80 |
|
|
|
81 |
|
| 26721 |
tejbeer |
82 |
|
| 26924 |
amit.gupta |
83 |
@Override
|
|
|
84 |
public int hashCode() {
|
|
|
85 |
final int prime = 31;
|
|
|
86 |
int result = 1;
|
|
|
87 |
result = prime * result + ((createTimestamp == null) ? 0 : createTimestamp.hashCode());
|
|
|
88 |
result = prime * result + id;
|
|
|
89 |
result = prime * result + ((imgUrl == null) ? 0 : imgUrl.hashCode());
|
|
|
90 |
result = prime * result + itemId;
|
|
|
91 |
result = prime * result + ((itemName == null) ? 0 : itemName.hashCode());
|
|
|
92 |
result = prime * result + orderId;
|
|
|
93 |
result = prime * result + quantity;
|
|
|
94 |
result = prime * result + ((scheduledDeliveryTime == null) ? 0 : scheduledDeliveryTime.hashCode());
|
|
|
95 |
result = prime * result + Float.floatToIntBits(sellingPrice);
|
|
|
96 |
result = prime * result + ((status == null) ? 0 : status.hashCode());
|
|
|
97 |
return result;
|
|
|
98 |
}
|
|
|
99 |
|
|
|
100 |
@Override
|
|
|
101 |
public boolean equals(Object obj) {
|
|
|
102 |
if (this == obj)
|
|
|
103 |
return true;
|
|
|
104 |
if (obj == null)
|
|
|
105 |
return false;
|
|
|
106 |
if (getClass() != obj.getClass())
|
|
|
107 |
return false;
|
|
|
108 |
PendingOrderItem other = (PendingOrderItem) obj;
|
|
|
109 |
if (createTimestamp == null) {
|
|
|
110 |
if (other.createTimestamp != null)
|
|
|
111 |
return false;
|
|
|
112 |
} else if (!createTimestamp.equals(other.createTimestamp))
|
|
|
113 |
return false;
|
|
|
114 |
if (id != other.id)
|
|
|
115 |
return false;
|
|
|
116 |
if (imgUrl == null) {
|
|
|
117 |
if (other.imgUrl != null)
|
|
|
118 |
return false;
|
|
|
119 |
} else if (!imgUrl.equals(other.imgUrl))
|
|
|
120 |
return false;
|
|
|
121 |
if (itemId != other.itemId)
|
|
|
122 |
return false;
|
|
|
123 |
if (itemName == null) {
|
|
|
124 |
if (other.itemName != null)
|
|
|
125 |
return false;
|
|
|
126 |
} else if (!itemName.equals(other.itemName))
|
|
|
127 |
return false;
|
|
|
128 |
if (orderId != other.orderId)
|
|
|
129 |
return false;
|
|
|
130 |
if (quantity != other.quantity)
|
|
|
131 |
return false;
|
|
|
132 |
if (scheduledDeliveryTime == null) {
|
|
|
133 |
if (other.scheduledDeliveryTime != null)
|
|
|
134 |
return false;
|
|
|
135 |
} else if (!scheduledDeliveryTime.equals(other.scheduledDeliveryTime))
|
|
|
136 |
return false;
|
|
|
137 |
if (Float.floatToIntBits(sellingPrice) != Float.floatToIntBits(other.sellingPrice))
|
|
|
138 |
return false;
|
|
|
139 |
if (status == null) {
|
|
|
140 |
if (other.status != null)
|
|
|
141 |
return false;
|
|
|
142 |
} else if (!status.equals(other.status))
|
|
|
143 |
return false;
|
|
|
144 |
return true;
|
|
|
145 |
}
|
|
|
146 |
|
|
|
147 |
public LocalDateTime getScheduledDeliveryTime() {
|
|
|
148 |
return scheduledDeliveryTime;
|
|
|
149 |
}
|
|
|
150 |
|
|
|
151 |
public void setScheduledDeliveryTime(LocalDateTime scheduledDeliveryTime) {
|
|
|
152 |
this.scheduledDeliveryTime = scheduledDeliveryTime;
|
|
|
153 |
}
|
|
|
154 |
|
| 26721 |
tejbeer |
155 |
public void setStatus(String status) {
|
|
|
156 |
this.status = status;
|
|
|
157 |
}
|
|
|
158 |
|
| 26629 |
tejbeer |
159 |
public int getId() {
|
|
|
160 |
return id;
|
|
|
161 |
}
|
|
|
162 |
|
|
|
163 |
public void setId(int id) {
|
|
|
164 |
this.id = id;
|
|
|
165 |
}
|
|
|
166 |
|
|
|
167 |
public int getOrderId() {
|
|
|
168 |
return orderId;
|
|
|
169 |
}
|
|
|
170 |
|
|
|
171 |
public void setOrderId(int orderId) {
|
|
|
172 |
this.orderId = orderId;
|
|
|
173 |
}
|
|
|
174 |
|
|
|
175 |
public int getItemId() {
|
|
|
176 |
return itemId;
|
|
|
177 |
}
|
|
|
178 |
|
|
|
179 |
public void setItemId(int itemId) {
|
|
|
180 |
this.itemId = itemId;
|
|
|
181 |
}
|
|
|
182 |
|
|
|
183 |
public int getQuantity() {
|
|
|
184 |
return quantity;
|
|
|
185 |
}
|
|
|
186 |
|
|
|
187 |
public void setQuantity(int quantity) {
|
|
|
188 |
this.quantity = quantity;
|
|
|
189 |
}
|
|
|
190 |
|
|
|
191 |
public float getSellingPrice() {
|
|
|
192 |
return sellingPrice;
|
|
|
193 |
}
|
|
|
194 |
|
|
|
195 |
public void setSellingPrice(float sellingPrice) {
|
|
|
196 |
this.sellingPrice = sellingPrice;
|
|
|
197 |
}
|
|
|
198 |
|
|
|
199 |
public LocalDateTime getCreateTimestamp() {
|
|
|
200 |
return createTimestamp;
|
|
|
201 |
}
|
|
|
202 |
|
|
|
203 |
public void setCreateTimestamp(LocalDateTime createTimestamp) {
|
|
|
204 |
this.createTimestamp = createTimestamp;
|
|
|
205 |
}
|
|
|
206 |
|
|
|
207 |
public static long getSerialversionuid() {
|
|
|
208 |
return serialVersionUID;
|
|
|
209 |
}
|
|
|
210 |
|
|
|
211 |
@Override
|
|
|
212 |
public String toString() {
|
| 26924 |
amit.gupta |
213 |
return "PendingOrderItem [id=" + id + ", orderId=" + orderId + ", itemId=" + itemId + ", itemName=" + itemName
|
|
|
214 |
+ ", imgUrl=" + imgUrl + ", quantity=" + quantity + ", sellingPrice=" + sellingPrice + ", status="
|
|
|
215 |
+ status + ", scheduledDeliveryTime=" + scheduledDeliveryTime + ", createTimestamp=" + createTimestamp
|
| 26721 |
tejbeer |
216 |
+ "]";
|
| 26629 |
tejbeer |
217 |
}
|
|
|
218 |
|
|
|
219 |
}
|