Subversion Repositories SmartDukaan

Rev

Rev 28339 | Rev 28352 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
26629 tejbeer 1
package com.spice.profitmandi.dao.entity.fofo;
2
 
3
import java.io.Serializable;
4
import java.time.LocalDateTime;
28339 tejbeer 5
import java.util.List;
26629 tejbeer 6
 
7
import javax.persistence.Column;
8
import javax.persistence.Convert;
9
import javax.persistence.Entity;
27046 tejbeer 10
import javax.persistence.EnumType;
11
import javax.persistence.Enumerated;
26629 tejbeer 12
import javax.persistence.GeneratedValue;
13
import javax.persistence.GenerationType;
14
import javax.persistence.Id;
15
import javax.persistence.Table;
26817 amit.gupta 16
import javax.persistence.Transient;
26629 tejbeer 17
import javax.persistence.UniqueConstraint;
18
 
19
import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;
27046 tejbeer 20
import com.spice.profitmandi.dao.enumuration.transaction.OrderStatus;
26629 tejbeer 21
 
22
@Entity
23
@Table(name = "fofo.pending_order_item", schema = "fofo", uniqueConstraints = {
24
		@UniqueConstraint(name = "UK_ORDER_ID_AND_ITEM_ID", columnNames = { "order_id", "item_id" }) })
25
public class PendingOrderItem implements Serializable {
26
 
27046 tejbeer 27
	public OrderStatus getStatus() {
28
		return status;
29
	}
30
 
26817 amit.gupta 31
	public String getItemName() {
32
		return itemName;
33
	}
34
 
35
	public void setItemName(String itemName) {
36
		this.itemName = itemName;
37
	}
38
 
26629 tejbeer 39
	private static final long serialVersionUID = 1L;
40
 
41
	@Id
42
	@Column(name = "id")
43
	@GeneratedValue(strategy = GenerationType.IDENTITY)
44
	private int id;
45
 
46
	@Column(name = "order_id")
47
	private int orderId;
48
 
49
	@Column(name = "item_id")
50
	private int itemId;
27046 tejbeer 51
 
26817 amit.gupta 52
	@Transient
53
	private String itemName;
27046 tejbeer 54
 
26924 amit.gupta 55
	@Transient
56
	private String imgUrl;
26629 tejbeer 57
 
26924 amit.gupta 58
	public String getImgUrl() {
59
		return imgUrl;
60
	}
61
 
62
	public void setImgUrl(String imgUrl) {
63
		this.imgUrl = imgUrl;
64
	}
65
 
26629 tejbeer 66
	@Column(name = "quantity")
67
	private int quantity;
68
 
69
	@Column(name = "selling_price")
70
	private float sellingPrice;
71
 
28339 tejbeer 72
	@Transient
73
	private PendingOrder pendingOrder;
74
 
75
	public PendingOrder getPendingOrder() {
76
		return pendingOrder;
77
	}
78
 
79
	public void setPendingOrder(PendingOrder pendingOrder) {
80
		this.pendingOrder = pendingOrder;
81
	}
82
 
26721 tejbeer 83
	@Column(name = "status")
27046 tejbeer 84
	@Enumerated(EnumType.STRING)
85
	private OrderStatus status;
86
 
87
	@Column(name = "status_description")
88
	private String statusDescription;
28339 tejbeer 89
 
28311 amit.gupta 90
	@Column(name = "cancelled_timestamp")
91
	private LocalDateTime cancelledTimestamp;
27046 tejbeer 92
 
93
	@Column(name = "billed_timestamp")
94
	private LocalDateTime billedTimestamp;
95
 
28344 tejbeer 96
	@Column(name = "verified_timestamp")
97
	private LocalDateTime verifiedTimestamp;
98
 
99
	public LocalDateTime getVerifiedTimestamp() {
100
		return verifiedTimestamp;
101
	}
102
 
103
	public void setVerifiedTimestamp(LocalDateTime verifiedTimestamp) {
104
		this.verifiedTimestamp = verifiedTimestamp;
105
	}
106
 
28339 tejbeer 107
	@Column(name = "delivered_timestamp")
108
	private LocalDateTime deliveredTimestamp;
109
 
110
	@Column(name = "claimed_timestamp")
111
	private LocalDateTime claimedTimestamp;
112
 
113
	public LocalDateTime getClaimedTimestamp() {
114
		return claimedTimestamp;
115
	}
116
 
117
	public void setClaimedTimestamp(LocalDateTime claimedTimestamp) {
118
		this.claimedTimestamp = claimedTimestamp;
119
	}
120
 
121
	public LocalDateTime getDeliveredTimestamp() {
122
		return deliveredTimestamp;
123
	}
124
 
125
	public void setDeliveredTimestamp(LocalDateTime deliveredTimestamp) {
126
		this.deliveredTimestamp = deliveredTimestamp;
127
	}
128
 
27046 tejbeer 129
	public String getStatusDescription() {
130
		return statusDescription;
131
	}
132
 
133
	public LocalDateTime getBilledTimestamp() {
134
		return billedTimestamp;
135
	}
136
 
137
	public void setBilledTimestamp(LocalDateTime billedTimestamp) {
138
		this.billedTimestamp = billedTimestamp;
139
	}
140
 
141
	public void setStatusDescription(String statusDescription) {
142
		this.statusDescription = statusDescription;
143
	}
144
 
145
	public void setStatus(OrderStatus status) {
146
		this.status = status;
147
	}
148
 
28311 amit.gupta 149
	public LocalDateTime getCancelledTimestamp() {
150
		return cancelledTimestamp;
151
	}
152
 
153
	public void setCancelledTimestamp(LocalDateTime cancelledTimestamp) {
154
		this.cancelledTimestamp = cancelledTimestamp;
155
	}
156
 
26924 amit.gupta 157
	@Column(name = "scheduled_delivery_time")
158
	private LocalDateTime scheduledDeliveryTime;
26721 tejbeer 159
 
26629 tejbeer 160
	@Convert(converter = LocalDateTimeAttributeConverter.class)
161
	@Column(name = "create_timestamp")
162
	private LocalDateTime createTimestamp = LocalDateTime.now();
163
 
26924 amit.gupta 164
	@Override
165
	public int hashCode() {
166
		final int prime = 31;
167
		int result = 1;
28311 amit.gupta 168
		result = prime * result + ((billedTimestamp == null) ? 0 : billedTimestamp.hashCode());
169
		result = prime * result + ((cancelledTimestamp == null) ? 0 : cancelledTimestamp.hashCode());
28339 tejbeer 170
		result = prime * result + ((claimedTimestamp == null) ? 0 : claimedTimestamp.hashCode());
26924 amit.gupta 171
		result = prime * result + ((createTimestamp == null) ? 0 : createTimestamp.hashCode());
28339 tejbeer 172
		result = prime * result + ((deliveredTimestamp == null) ? 0 : deliveredTimestamp.hashCode());
26924 amit.gupta 173
		result = prime * result + id;
174
		result = prime * result + ((imgUrl == null) ? 0 : imgUrl.hashCode());
175
		result = prime * result + itemId;
176
		result = prime * result + ((itemName == null) ? 0 : itemName.hashCode());
177
		result = prime * result + orderId;
28339 tejbeer 178
		result = prime * result + ((pendingOrder == null) ? 0 : pendingOrder.hashCode());
26924 amit.gupta 179
		result = prime * result + quantity;
180
		result = prime * result + ((scheduledDeliveryTime == null) ? 0 : scheduledDeliveryTime.hashCode());
181
		result = prime * result + Float.floatToIntBits(sellingPrice);
182
		result = prime * result + ((status == null) ? 0 : status.hashCode());
28311 amit.gupta 183
		result = prime * result + ((statusDescription == null) ? 0 : statusDescription.hashCode());
28344 tejbeer 184
		result = prime * result + ((verifiedTimestamp == null) ? 0 : verifiedTimestamp.hashCode());
26924 amit.gupta 185
		return result;
186
	}
187
 
188
	@Override
189
	public boolean equals(Object obj) {
190
		if (this == obj)
191
			return true;
192
		if (obj == null)
193
			return false;
194
		if (getClass() != obj.getClass())
195
			return false;
196
		PendingOrderItem other = (PendingOrderItem) obj;
28311 amit.gupta 197
		if (billedTimestamp == null) {
198
			if (other.billedTimestamp != null)
199
				return false;
200
		} else if (!billedTimestamp.equals(other.billedTimestamp))
201
			return false;
202
		if (cancelledTimestamp == null) {
203
			if (other.cancelledTimestamp != null)
204
				return false;
205
		} else if (!cancelledTimestamp.equals(other.cancelledTimestamp))
206
			return false;
28339 tejbeer 207
		if (claimedTimestamp == null) {
208
			if (other.claimedTimestamp != null)
209
				return false;
210
		} else if (!claimedTimestamp.equals(other.claimedTimestamp))
211
			return false;
26924 amit.gupta 212
		if (createTimestamp == null) {
213
			if (other.createTimestamp != null)
214
				return false;
215
		} else if (!createTimestamp.equals(other.createTimestamp))
216
			return false;
28339 tejbeer 217
		if (deliveredTimestamp == null) {
218
			if (other.deliveredTimestamp != null)
219
				return false;
220
		} else if (!deliveredTimestamp.equals(other.deliveredTimestamp))
221
			return false;
26924 amit.gupta 222
		if (id != other.id)
223
			return false;
224
		if (imgUrl == null) {
225
			if (other.imgUrl != null)
226
				return false;
227
		} else if (!imgUrl.equals(other.imgUrl))
228
			return false;
229
		if (itemId != other.itemId)
230
			return false;
231
		if (itemName == null) {
232
			if (other.itemName != null)
233
				return false;
234
		} else if (!itemName.equals(other.itemName))
235
			return false;
236
		if (orderId != other.orderId)
237
			return false;
28339 tejbeer 238
		if (pendingOrder == null) {
239
			if (other.pendingOrder != null)
240
				return false;
241
		} else if (!pendingOrder.equals(other.pendingOrder))
242
			return false;
26924 amit.gupta 243
		if (quantity != other.quantity)
244
			return false;
245
		if (scheduledDeliveryTime == null) {
246
			if (other.scheduledDeliveryTime != null)
247
				return false;
248
		} else if (!scheduledDeliveryTime.equals(other.scheduledDeliveryTime))
249
			return false;
250
		if (Float.floatToIntBits(sellingPrice) != Float.floatToIntBits(other.sellingPrice))
251
			return false;
28311 amit.gupta 252
		if (status != other.status)
253
			return false;
254
		if (statusDescription == null) {
255
			if (other.statusDescription != null)
26924 amit.gupta 256
				return false;
28311 amit.gupta 257
		} else if (!statusDescription.equals(other.statusDescription))
26924 amit.gupta 258
			return false;
28344 tejbeer 259
		if (verifiedTimestamp == null) {
260
			if (other.verifiedTimestamp != null)
261
				return false;
262
		} else if (!verifiedTimestamp.equals(other.verifiedTimestamp))
263
			return false;
26924 amit.gupta 264
		return true;
265
	}
266
 
267
	public LocalDateTime getScheduledDeliveryTime() {
268
		return scheduledDeliveryTime;
269
	}
270
 
271
	public void setScheduledDeliveryTime(LocalDateTime scheduledDeliveryTime) {
272
		this.scheduledDeliveryTime = scheduledDeliveryTime;
273
	}
274
 
26629 tejbeer 275
	public int getId() {
276
		return id;
277
	}
278
 
279
	public void setId(int id) {
280
		this.id = id;
281
	}
282
 
283
	public int getOrderId() {
284
		return orderId;
285
	}
286
 
287
	public void setOrderId(int orderId) {
288
		this.orderId = orderId;
289
	}
290
 
291
	public int getItemId() {
292
		return itemId;
293
	}
294
 
295
	public void setItemId(int itemId) {
296
		this.itemId = itemId;
297
	}
298
 
299
	public int getQuantity() {
300
		return quantity;
301
	}
302
 
303
	public void setQuantity(int quantity) {
304
		this.quantity = quantity;
305
	}
306
 
307
	public float getSellingPrice() {
308
		return sellingPrice;
309
	}
310
 
311
	public void setSellingPrice(float sellingPrice) {
312
		this.sellingPrice = sellingPrice;
313
	}
314
 
315
	public LocalDateTime getCreateTimestamp() {
316
		return createTimestamp;
317
	}
318
 
319
	public void setCreateTimestamp(LocalDateTime createTimestamp) {
320
		this.createTimestamp = createTimestamp;
321
	}
322
 
323
	public static long getSerialversionuid() {
324
		return serialVersionUID;
325
	}
326
 
327
	@Override
328
	public String toString() {
26924 amit.gupta 329
		return "PendingOrderItem [id=" + id + ", orderId=" + orderId + ", itemId=" + itemId + ", itemName=" + itemName
28339 tejbeer 330
				+ ", imgUrl=" + imgUrl + ", quantity=" + quantity + ", sellingPrice=" + sellingPrice + ", pendingOrder="
331
				+ pendingOrder + ", status=" + status + ", statusDescription=" + statusDescription
332
				+ ", cancelledTimestamp=" + cancelledTimestamp + ", billedTimestamp=" + billedTimestamp
28344 tejbeer 333
				+ ", verifiedTimestamp=" + verifiedTimestamp + ", deliveredTimestamp=" + deliveredTimestamp
334
				+ ", claimedTimestamp=" + claimedTimestamp + ", scheduledDeliveryTime=" + scheduledDeliveryTime
335
				+ ", createTimestamp=" + createTimestamp + "]";
26629 tejbeer 336
	}
337
 
338
}