Subversion Repositories SmartDukaan

Rev

Rev 26924 | Rev 28311 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 26924 Rev 27046
Line 4... Line 4...
4
import java.time.LocalDateTime;
4
import java.time.LocalDateTime;
5
 
5
 
6
import javax.persistence.Column;
6
import javax.persistence.Column;
7
import javax.persistence.Convert;
7
import javax.persistence.Convert;
8
import javax.persistence.Entity;
8
import javax.persistence.Entity;
-
 
9
import javax.persistence.EnumType;
-
 
10
import javax.persistence.Enumerated;
9
import javax.persistence.GeneratedValue;
11
import javax.persistence.GeneratedValue;
10
import javax.persistence.GenerationType;
12
import javax.persistence.GenerationType;
11
import javax.persistence.Id;
13
import javax.persistence.Id;
12
import javax.persistence.Table;
14
import javax.persistence.Table;
13
import javax.persistence.Transient;
15
import javax.persistence.Transient;
14
import javax.persistence.UniqueConstraint;
16
import javax.persistence.UniqueConstraint;
15
 
17
 
16
import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;
18
import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;
-
 
19
import com.spice.profitmandi.dao.enumuration.transaction.OrderStatus;
17
 
20
 
18
@Entity
21
@Entity
19
@Table(name = "fofo.pending_order_item", schema = "fofo", uniqueConstraints = {
22
@Table(name = "fofo.pending_order_item", schema = "fofo", uniqueConstraints = {
20
		@UniqueConstraint(name = "UK_ORDER_ID_AND_ITEM_ID", columnNames = { "order_id", "item_id" }) })
23
		@UniqueConstraint(name = "UK_ORDER_ID_AND_ITEM_ID", columnNames = { "order_id", "item_id" }) })
21
public class PendingOrderItem implements Serializable {
24
public class PendingOrderItem implements Serializable {
22
 
25
 
-
 
26
	public OrderStatus getStatus() {
-
 
27
		return status;
-
 
28
	}
-
 
29
 
23
	public String getItemName() {
30
	public String getItemName() {
24
		return itemName;
31
		return itemName;
25
	}
32
	}
26
 
33
 
27
	public void setItemName(String itemName) {
34
	public void setItemName(String itemName) {
Line 38... Line 45...
38
	@Column(name = "order_id")
45
	@Column(name = "order_id")
39
	private int orderId;
46
	private int orderId;
40
 
47
 
41
	@Column(name = "item_id")
48
	@Column(name = "item_id")
42
	private int itemId;
49
	private int itemId;
43
	
50
 
44
	@Transient
51
	@Transient
45
	private String itemName;
52
	private String itemName;
46
	
53
 
47
	@Transient
54
	@Transient
48
	private String imgUrl;
55
	private String imgUrl;
49
	
-
 
50
	
-
 
51
 
56
 
52
	public String getImgUrl() {
57
	public String getImgUrl() {
53
		return imgUrl;
58
		return imgUrl;
54
	}
59
	}
55
 
60
 
Line 62... Line 67...
62
 
67
 
63
	@Column(name = "selling_price")
68
	@Column(name = "selling_price")
64
	private float sellingPrice;
69
	private float sellingPrice;
65
 
70
 
66
	@Column(name = "status")
71
	@Column(name = "status")
-
 
72
	@Enumerated(EnumType.STRING)
67
	private String status;
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;
68
	
99
	}
-
 
100
 
69
	@Column(name = "scheduled_delivery_time")
101
	@Column(name = "scheduled_delivery_time")
70
	private LocalDateTime scheduledDeliveryTime;
102
	private LocalDateTime scheduledDeliveryTime;
71
 
103
 
72
	@Convert(converter = LocalDateTimeAttributeConverter.class)
104
	@Convert(converter = LocalDateTimeAttributeConverter.class)
73
	@Column(name = "create_timestamp")
105
	@Column(name = "create_timestamp")
74
	private LocalDateTime createTimestamp = LocalDateTime.now();
106
	private LocalDateTime createTimestamp = LocalDateTime.now();
75
 
107
 
76
	public String getStatus() {
-
 
77
		return status;
-
 
78
	}
-
 
79
	
-
 
80
	
-
 
81
	
-
 
82
 
-
 
83
	@Override
108
	@Override
84
	public int hashCode() {
109
	public int hashCode() {
85
		final int prime = 31;
110
		final int prime = 31;
86
		int result = 1;
111
		int result = 1;
87
		result = prime * result + ((createTimestamp == null) ? 0 : createTimestamp.hashCode());
112
		result = prime * result + ((createTimestamp == null) ? 0 : createTimestamp.hashCode());
Line 150... Line 175...
150
 
175
 
151
	public void setScheduledDeliveryTime(LocalDateTime scheduledDeliveryTime) {
176
	public void setScheduledDeliveryTime(LocalDateTime scheduledDeliveryTime) {
152
		this.scheduledDeliveryTime = scheduledDeliveryTime;
177
		this.scheduledDeliveryTime = scheduledDeliveryTime;
153
	}
178
	}
154
 
179
 
155
	public void setStatus(String status) {
-
 
156
		this.status = status;
-
 
157
	}
-
 
158
 
-
 
159
	public int getId() {
180
	public int getId() {
160
		return id;
181
		return id;
161
	}
182
	}
162
 
183
 
163
	public void setId(int id) {
184
	public void setId(int id) {
Line 210... Line 231...
210
 
231
 
211
	@Override
232
	@Override
212
	public String toString() {
233
	public String toString() {
213
		return "PendingOrderItem [id=" + id + ", orderId=" + orderId + ", itemId=" + itemId + ", itemName=" + itemName
234
		return "PendingOrderItem [id=" + id + ", orderId=" + orderId + ", itemId=" + itemId + ", itemName=" + itemName
214
				+ ", imgUrl=" + imgUrl + ", quantity=" + quantity + ", sellingPrice=" + sellingPrice + ", status="
235
				+ ", imgUrl=" + imgUrl + ", quantity=" + quantity + ", sellingPrice=" + sellingPrice + ", status="
-
 
236
				+ status + ", statusDescription=" + statusDescription + ", billedTimestamp=" + billedTimestamp
215
				+ status + ", scheduledDeliveryTime=" + scheduledDeliveryTime + ", createTimestamp=" + createTimestamp
237
				+ ", scheduledDeliveryTime=" + scheduledDeliveryTime + ", createTimestamp=" + createTimestamp + "]";
216
				+ "]";
-
 
217
	}
238
	}
218
 
239
 
219
}
240
}