Subversion Repositories SmartDukaan

Rev

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