Subversion Repositories SmartDukaan

Rev

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

Rev 21989 Rev 22009
Line 2... Line 2...
2
 
2
 
3
import java.io.Serializable;
3
import java.io.Serializable;
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.Entity;
8
import javax.persistence.Entity;
8
import javax.persistence.EnumType;
9
import javax.persistence.EnumType;
9
import javax.persistence.Enumerated;
10
import javax.persistence.Enumerated;
10
import javax.persistence.GeneratedValue;
11
import javax.persistence.GeneratedValue;
11
import javax.persistence.GenerationType;
12
import javax.persistence.GenerationType;
12
import javax.persistence.Id;
13
import javax.persistence.Id;
13
import javax.persistence.NamedQueries;
14
import javax.persistence.NamedQueries;
14
import javax.persistence.NamedQuery;
15
import javax.persistence.NamedQuery;
15
import javax.persistence.Table;
16
import javax.persistence.Table;
16
 
17
 
-
 
18
import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;
-
 
19
 
17
import in.shop2020.model.v1.order.TransactionStatus;
20
import in.shop2020.model.v1.order.TransactionStatus;
18
 
21
 
19
/**
22
/**
20
 * This class basically contains transaction details
23
 * This class basically contains transaction details
21
 * 
24
 * 
Line 49... Line 52...
49
	@Id
52
	@Id
50
	@Column(name="id", unique=true, updatable=false)
53
	@Column(name="id", unique=true, updatable=false)
51
	@GeneratedValue(strategy = GenerationType.IDENTITY)
54
	@GeneratedValue(strategy = GenerationType.IDENTITY)
52
	private int id;
55
	private int id;
53
	
56
	
-
 
57
	@Convert(converter = LocalDateTimeAttributeConverter.class)
54
	@Column(name = "createdOn")
58
	@Column(name = "createdOn")
55
	private LocalDateTime createTimestamp;
59
	private LocalDateTime createTimestamp;
56
	
60
	
57
	@Enumerated(EnumType.ORDINAL)
61
	@Enumerated(EnumType.ORDINAL)
58
	@Column(name = "status")
62
	@Column(name = "status")
Line 71... Line 75...
71
	private String couponCode;
75
	private String couponCode;
72
	
76
	
73
	@Column(name = "session_source", length = 100)
77
	@Column(name = "session_source", length = 100)
74
	private String sessionSource;
78
	private String sessionSource;
75
	
79
	
-
 
80
	@Convert(converter = LocalDateTimeAttributeConverter.class)
76
	@Column(name = "session_start_time")
81
	@Column(name = "session_start_time")
77
	private LocalDateTime sessionStateTime;
82
	private LocalDateTime sessionStateTime;
78
	
83
	
79
	@Column(name = "first_source")
84
	@Column(name = "first_source")
80
	private String firstSource;
85
	private String firstSource;
81
	
86
	
-
 
87
	@Convert(converter = LocalDateTimeAttributeConverter.class)
82
	@Column(name = "first_source_start_time")
88
	@Column(name = "first_source_start_time")
83
	private LocalDateTime firstSourceStateTime;
89
	private LocalDateTime firstSourceStateTime;
84
	
90
	
85
	@Column(name = "totalShippingCost")
91
	@Column(name = "totalShippingCost")
86
	private float totalShippingCost;
92
	private float totalShippingCost;
Line 177... Line 183...
177
	public void setPaymentOption(int paymentOption) {
183
	public void setPaymentOption(int paymentOption) {
178
		this.paymentOption = paymentOption;
184
		this.paymentOption = paymentOption;
179
	}
185
	}
180
	
186
	
181
	
187
	
182
	
-
 
183
	@Override
188
	@Override
184
	public int hashCode() {
189
	public int hashCode() {
185
		final int prime = 31;
190
		final int prime = 31;
186
		int result = 1;
191
		int result = 1;
187
		result = prime * result + ((couponCode == null) ? 0 : couponCode.hashCode());
-
 
188
		result = prime * result + ((createTimestamp == null) ? 0 : createTimestamp.hashCode());
-
 
189
		result = prime * result + ((firstSource == null) ? 0 : firstSource.hashCode());
-
 
190
		result = prime * result + ((firstSourceStateTime == null) ? 0 : firstSourceStateTime.hashCode());
-
 
191
		result = prime * result + id;
192
		result = prime * result + id;
192
		result = prime * result + paymentOption;
-
 
193
		result = prime * result + retailerId;
-
 
194
		result = prime * result + ((sessionSource == null) ? 0 : sessionSource.hashCode());
-
 
195
		result = prime * result + ((sessionStateTime == null) ? 0 : sessionStateTime.hashCode());
-
 
196
		result = prime * result + shoppingCartId;
-
 
197
		result = prime * result + ((status == null) ? 0 : status.hashCode());
-
 
198
		result = prime * result + ((statusMessage == null) ? 0 : statusMessage.hashCode());
-
 
199
		result = prime * result + Float.floatToIntBits(totalCodCharges);
-
 
200
		result = prime * result + Float.floatToIntBits(totalShippingCost);
-
 
201
		return result;
193
		return result;
202
	}
194
	}
203
	@Override
195
	@Override
204
	public boolean equals(Object obj) {
196
	public boolean equals(Object obj) {
205
		if (this == obj)
197
		if (this == obj)
Line 207... Line 199...
207
		if (obj == null)
199
		if (obj == null)
208
			return false;
200
			return false;
209
		if (getClass() != obj.getClass())
201
		if (getClass() != obj.getClass())
210
			return false;
202
			return false;
211
		Transaction other = (Transaction) obj;
203
		Transaction other = (Transaction) obj;
212
		if (couponCode == null) {
-
 
213
			if (other.couponCode != null)
-
 
214
				return false;
-
 
215
		} else if (!couponCode.equals(other.couponCode))
-
 
216
			return false;
-
 
217
		if (createTimestamp == null) {
-
 
218
			if (other.createTimestamp != null)
-
 
219
				return false;
-
 
220
		} else if (!createTimestamp.equals(other.createTimestamp))
-
 
221
			return false;
-
 
222
		if (firstSource == null) {
-
 
223
			if (other.firstSource != null)
-
 
224
				return false;
-
 
225
		} else if (!firstSource.equals(other.firstSource))
-
 
226
			return false;
-
 
227
		if (firstSourceStateTime == null) {
-
 
228
			if (other.firstSourceStateTime != null)
-
 
229
				return false;
-
 
230
		} else if (!firstSourceStateTime.equals(other.firstSourceStateTime))
-
 
231
			return false;
-
 
232
		if (id != other.id)
204
		if (id != other.id)
233
			return false;
205
			return false;
234
		if (paymentOption != other.paymentOption)
-
 
235
			return false;
-
 
236
		if (retailerId != other.retailerId)
-
 
237
			return false;
-
 
238
		if (sessionSource == null) {
-
 
239
			if (other.sessionSource != null)
-
 
240
				return false;
-
 
241
		} else if (!sessionSource.equals(other.sessionSource))
-
 
242
			return false;
-
 
243
		if (sessionStateTime == null) {
-
 
244
			if (other.sessionStateTime != null)
-
 
245
				return false;
-
 
246
		} else if (!sessionStateTime.equals(other.sessionStateTime))
-
 
247
			return false;
-
 
248
		if (shoppingCartId != other.shoppingCartId)
-
 
249
			return false;
-
 
250
		if (status != other.status)
-
 
251
			return false;
-
 
252
		if (statusMessage == null) {
-
 
253
			if (other.statusMessage != null)
-
 
254
				return false;
-
 
255
		} else if (!statusMessage.equals(other.statusMessage))
-
 
256
			return false;
-
 
257
		if (Float.floatToIntBits(totalCodCharges) != Float.floatToIntBits(other.totalCodCharges))
-
 
258
			return false;
-
 
259
		if (Float.floatToIntBits(totalShippingCost) != Float.floatToIntBits(other.totalShippingCost))
-
 
260
			return false;
-
 
261
		return true;
206
		return true;
262
	}
207
	}
263
	@Override
208
	@Override
264
	public String toString() {
209
	public String toString() {
265
		return "Transaction [createTimestamp=" + createTimestamp + ", status=" + status + ", statusMessage="
210
		return "Transaction [createTimestamp=" + createTimestamp + ", status=" + status + ", statusMessage="