Subversion Repositories SmartDukaan

Rev

Rev 24423 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
24421 amit.gupta 1
package com.spice.profitmandi.dao.entity.user;
2
 
3
import java.time.LocalDateTime;
4
 
5
import javax.persistence.Column;
6
import javax.persistence.Entity;
7
import javax.persistence.Id;
8
import javax.persistence.Table;
9
 
10
/**
11
 * This class basically contains cart details
12
 * 
13
 * @author ashikali
14
 *
15
 */
16
@Entity
17
@Table(name="user.line", schema = "user")
18
 
19
public class CartLine {
20
	@Id
21
	@Column(name="cart_id")
22
	private int cartId;
23
	@Id
24
	@Column(name="item_id")
25
	private int itemId;
26
 
27
	@Column(name="quantity")
28
	private int quantity;
29
 
30
	@Column(name="line_status")
31
	private int lineStatus;
32
 
33
	@Column(name="estimate")
34
	private int estimate;
35
 
36
	@Column(name="created_on")
37
	private LocalDateTime createTimestamp;
38
 
39
	@Column(name="updated_on")
40
	private LocalDateTime updateTimestapm;
41
 
42
	@Column(name="actual_price")
43
	private float actualPrice;
44
 
45
	@Column(name="discounted_price")
46
	private float discountedPrice;
47
 
48
	@Column(name="insurer")
49
	private int insurer;
50
 
51
	@Column(name="insuranceAmount")
52
	private float insuranceAmount;
53
 
54
	@Column(name="dataProtectionInsurer")
55
	private int dataProtectionInsurer;
56
 
57
	@Column(name="dataProtectionAmount")
58
	private float dataProtectionAmount;
59
 
60
	@Column(name="dealText")
61
	private String dealText;
62
 
63
	@Override
64
	public String toString() {
65
		return "CartLine [cartId=" + cartId + ", itemId=" + itemId + ", quantity=" + quantity + ", lineStatus="
66
				+ lineStatus + ", estimate=" + estimate + ", createTimestamp=" + createTimestamp + ", updateTimestapm="
67
				+ updateTimestapm + ", actualPrice=" + actualPrice + ", discountedPrice=" + discountedPrice
68
				+ ", insurer=" + insurer + ", insuranceAmount=" + insuranceAmount + ", dataProtectionInsurer="
69
				+ dataProtectionInsurer + ", dataProtectionAmount=" + dataProtectionAmount + ", dealText=" + dealText
70
				+ "]";
71
	}
72
 
73
	public int getCartId() {
74
		return cartId;
75
	}
76
 
77
	public void setCartId(int cartId) {
78
		this.cartId = cartId;
79
	}
80
 
81
	public int getItemId() {
82
		return itemId;
83
	}
84
 
85
	public void setItemId(int itemId) {
86
		this.itemId = itemId;
87
	}
88
 
89
	public int getQuantity() {
90
		return quantity;
91
	}
92
 
93
	public void setQuantity(int quantity) {
94
		this.quantity = quantity;
95
	}
96
 
97
	public int getLineStatus() {
98
		return lineStatus;
99
	}
100
 
101
	public void setLineStatus(int lineStatus) {
102
		this.lineStatus = lineStatus;
103
	}
104
 
105
	public int getEstimate() {
106
		return estimate;
107
	}
108
 
109
	public void setEstimate(int estimate) {
110
		this.estimate = estimate;
111
	}
112
 
113
	public LocalDateTime getCreateTimestamp() {
114
		return createTimestamp;
115
	}
116
 
117
	public void setCreateTimestamp(LocalDateTime createTimestamp) {
118
		this.createTimestamp = createTimestamp;
119
	}
120
 
121
	public LocalDateTime getUpdateTimestapm() {
122
		return updateTimestapm;
123
	}
124
 
125
	public void setUpdateTimestapm(LocalDateTime updateTimestapm) {
126
		this.updateTimestapm = updateTimestapm;
127
	}
128
 
129
	public float getActualPrice() {
130
		return actualPrice;
131
	}
132
 
133
	public void setActualPrice(float actualPrice) {
134
		this.actualPrice = actualPrice;
135
	}
136
 
137
	public float getDiscountedPrice() {
138
		return discountedPrice;
139
	}
140
 
141
	public void setDiscountedPrice(float discountedPrice) {
142
		this.discountedPrice = discountedPrice;
143
	}
144
 
145
	public int getInsurer() {
146
		return insurer;
147
	}
148
 
149
	public void setInsurer(int insurer) {
150
		this.insurer = insurer;
151
	}
152
 
153
	public float getInsuranceAmount() {
154
		return insuranceAmount;
155
	}
156
 
157
	public void setInsuranceAmount(float insuranceAmount) {
158
		this.insuranceAmount = insuranceAmount;
159
	}
160
 
161
	public int getDataProtectionInsurer() {
162
		return dataProtectionInsurer;
163
	}
164
 
165
	public void setDataProtectionInsurer(int dataProtectionInsurer) {
166
		this.dataProtectionInsurer = dataProtectionInsurer;
167
	}
168
 
169
	public float getDataProtectionAmount() {
170
		return dataProtectionAmount;
171
	}
172
 
173
	public void setDataProtectionAmount(float dataProtectionAmount) {
174
		this.dataProtectionAmount = dataProtectionAmount;
175
	}
176
 
177
	public String getDealText() {
178
		return dealText;
179
	}
180
 
181
	public void setDealText(String dealText) {
182
		this.dealText = dealText;
183
	}
184
 
185
	@Override
186
	public int hashCode() {
187
		final int prime = 31;
188
		int result = 1;
189
		result = prime * result + Float.floatToIntBits(actualPrice);
190
		result = prime * result + cartId;
191
		result = prime * result + ((createTimestamp == null) ? 0 : createTimestamp.hashCode());
192
		result = prime * result + Float.floatToIntBits(dataProtectionAmount);
193
		result = prime * result + dataProtectionInsurer;
194
		result = prime * result + ((dealText == null) ? 0 : dealText.hashCode());
195
		result = prime * result + Float.floatToIntBits(discountedPrice);
196
		result = prime * result + estimate;
197
		result = prime * result + Float.floatToIntBits(insuranceAmount);
198
		result = prime * result + insurer;
199
		result = prime * result + itemId;
200
		result = prime * result + lineStatus;
201
		result = prime * result + quantity;
202
		result = prime * result + ((updateTimestapm == null) ? 0 : updateTimestapm.hashCode());
203
		return result;
204
	}
205
 
206
	@Override
207
	public boolean equals(Object obj) {
208
		if (this == obj)
209
			return true;
210
		if (obj == null)
211
			return false;
212
		if (getClass() != obj.getClass())
213
			return false;
214
		CartLine other = (CartLine) obj;
215
		if (Float.floatToIntBits(actualPrice) != Float.floatToIntBits(other.actualPrice))
216
			return false;
217
		if (cartId != other.cartId)
218
			return false;
219
		if (createTimestamp == null) {
220
			if (other.createTimestamp != null)
221
				return false;
222
		} else if (!createTimestamp.equals(other.createTimestamp))
223
			return false;
224
		if (Float.floatToIntBits(dataProtectionAmount) != Float.floatToIntBits(other.dataProtectionAmount))
225
			return false;
226
		if (dataProtectionInsurer != other.dataProtectionInsurer)
227
			return false;
228
		if (dealText == null) {
229
			if (other.dealText != null)
230
				return false;
231
		} else if (!dealText.equals(other.dealText))
232
			return false;
233
		if (Float.floatToIntBits(discountedPrice) != Float.floatToIntBits(other.discountedPrice))
234
			return false;
235
		if (estimate != other.estimate)
236
			return false;
237
		if (Float.floatToIntBits(insuranceAmount) != Float.floatToIntBits(other.insuranceAmount))
238
			return false;
239
		if (insurer != other.insurer)
240
			return false;
241
		if (itemId != other.itemId)
242
			return false;
243
		if (lineStatus != other.lineStatus)
244
			return false;
245
		if (quantity != other.quantity)
246
			return false;
247
		if (updateTimestapm == null) {
248
			if (other.updateTimestapm != null)
249
				return false;
250
		} else if (!updateTimestapm.equals(other.updateTimestapm))
251
			return false;
252
		return true;
253
	}
254
 
255
 
256
}