Subversion Repositories SmartDukaan

Rev

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

Rev 21924 Rev 22009
Line 3... Line 3...
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.CascadeType;
6
import javax.persistence.CascadeType;
7
import javax.persistence.Column;
7
import javax.persistence.Column;
-
 
8
import javax.persistence.Convert;
8
import javax.persistence.Entity;
9
import javax.persistence.Entity;
9
import javax.persistence.FetchType;
10
import javax.persistence.FetchType;
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;
Line 14... Line 15...
14
import javax.persistence.NamedQueries;
15
import javax.persistence.NamedQueries;
15
import javax.persistence.NamedQuery;
16
import javax.persistence.NamedQuery;
16
import javax.persistence.OneToOne;
17
import javax.persistence.OneToOne;
17
import javax.persistence.Table;
18
import javax.persistence.Table;
18
 
19
 
-
 
20
import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;
19
import com.spice.profitmandi.dao.entity.catalog.Item;
21
import com.spice.profitmandi.dao.entity.catalog.Item;
20
 
22
 
21
/**
23
/**
22
 * This class basically contains api details
24
 * This class basically contains api details
23
 * 
25
 * 
Line 94... Line 96...
94
	private String itemNumber;
96
	private String itemNumber;
95
	
97
	
96
	@Column(name = "dealText", length = 100)
98
	@Column(name = "dealText", length = 100)
97
	private String dealText;
99
	private String dealText;
98
	
100
	
-
 
101
	@Convert(converter = LocalDateTimeAttributeConverter.class)
99
	@Column(name = "warranty_expiry_timestamp")
102
	@Column(name = "warranty_expiry_timestamp")
100
	private LocalDateTime warrantyExpiryTimestamp;
103
	private LocalDateTime warrantyExpiryTimestamp;
101
	
104
	
102
	@Column(name = "serial_number", length = 8192)
105
	@Column(name = "serial_number", length = 8192)
103
	private String serialNumber;
106
	private String serialNumber;
Line 115... Line 118...
115
	private Float codCollectionCharges;
118
	private Float codCollectionCharges;
116
	
119
	
117
	@Column(name = "returnQty")
120
	@Column(name = "returnQty")
118
	private Float returnQty;
121
	private Float returnQty;
119
	
122
	
-
 
123
	@Convert(converter = LocalDateTimeAttributeConverter.class)
120
	@Column(name = "damaged_expiry_timestamp")
124
	@Column(name = "damaged_expiry_timestamp")
121
	private LocalDateTime damagedExpiryTimestamp;
125
	private LocalDateTime damagedExpiryTimestamp;
122
	
126
	
123
	@OneToOne(cascade=CascadeType.ALL,fetch=FetchType.LAZY)
127
	@OneToOne(cascade=CascadeType.ALL,fetch=FetchType.LAZY)
124
	//@Fetch(value = FetchMode.SUBSELECT)
128
	//@Fetch(value = FetchMode.SUBSELECT)
Line 299... Line 303...
299
	
303
	
300
	@Override
304
	@Override
301
	public int hashCode() {
305
	public int hashCode() {
302
		final int prime = 31;
306
		final int prime = 31;
303
		int result = 1;
307
		int result = 1;
304
		result = prime * result + ((brand == null) ? 0 : brand.hashCode());
-
 
305
		result = prime * result + ((codCollectionCharges == null) ? 0 : codCollectionCharges.hashCode());
-
 
306
		result = prime * result + ((color == null) ? 0 : color.hashCode());
-
 
307
		result = prime * result + ((damagedExpiryTimestamp == null) ? 0 : damagedExpiryTimestamp.hashCode());
-
 
308
		result = prime * result + ((dealText == null) ? 0 : dealText.hashCode());
-
 
309
		result = prime * result + ((extraInfo == null) ? 0 : extraInfo.hashCode());
-
 
310
		result = prime * result + ((id == null) ? 0 : id.hashCode());
308
		result = prime * result + ((id == null) ? 0 : id.hashCode());
311
		result = prime * result + ((imeiNumber == null) ? 0 : imeiNumber.hashCode());
-
 
312
		result = prime * result + ((item == null) ? 0 : item.hashCode());
-
 
313
		result = prime * result + ((itemId == null) ? 0 : itemId.hashCode());
-
 
314
		result = prime * result + ((itemNumber == null) ? 0 : itemNumber.hashCode());
-
 
315
		result = prime * result + ((logisticsCost == null) ? 0 : logisticsCost.hashCode());
-
 
316
		result = prime * result + ((modelName == null) ? 0 : modelName.hashCode());
-
 
317
		result = prime * result + ((modelNumber == null) ? 0 : modelNumber.hashCode());
-
 
318
		result = prime * result + ((mrp == null) ? 0 : mrp.hashCode());
-
 
319
		result = prime * result + ((nlc == null) ? 0 : nlc.hashCode());
-
 
320
		result = prime * result + ((orderId == null) ? 0 : orderId.hashCode());
-
 
321
		result = prime * result + ((productGoup == null) ? 0 : productGoup.hashCode());
-
 
322
		result = prime * result + ((quantity == null) ? 0 : quantity.hashCode());
-
 
323
		result = prime * result + ((returnQty == null) ? 0 : returnQty.hashCode());
-
 
324
		result = prime * result + ((serialNumber == null) ? 0 : serialNumber.hashCode());
-
 
325
		result = prime * result + ((totalPrice == null) ? 0 : totalPrice.hashCode());
-
 
326
		result = prime * result + ((totalWeight == null) ? 0 : totalWeight.hashCode());
-
 
327
		result = prime * result + ((transferPrice == null) ? 0 : transferPrice.hashCode());
-
 
328
		result = prime * result + ((unitPrice == null) ? 0 : unitPrice.hashCode());
-
 
329
		result = prime * result + ((unitWeight == null) ? 0 : unitWeight.hashCode());
-
 
330
		result = prime * result + ((vatRate == null) ? 0 : vatRate.hashCode());
-
 
331
		result = prime * result + ((warrantyExpiryTimestamp == null) ? 0 : warrantyExpiryTimestamp.hashCode());
-
 
332
		return result;
309
		return result;
333
	}
310
	}
334
	@Override
311
	@Override
335
	public boolean equals(Object obj) {
312
	public boolean equals(Object obj) {
336
		if (this == obj)
313
		if (this == obj)
Line 338... Line 315...
338
		if (obj == null)
315
		if (obj == null)
339
			return false;
316
			return false;
340
		if (getClass() != obj.getClass())
317
		if (getClass() != obj.getClass())
341
			return false;
318
			return false;
342
		LineItem other = (LineItem) obj;
319
		LineItem other = (LineItem) obj;
343
		if (brand == null) {
-
 
344
			if (other.brand != null)
-
 
345
				return false;
-
 
346
		} else if (!brand.equals(other.brand))
-
 
347
			return false;
-
 
348
		if (codCollectionCharges == null) {
-
 
349
			if (other.codCollectionCharges != null)
-
 
350
				return false;
-
 
351
		} else if (!codCollectionCharges.equals(other.codCollectionCharges))
-
 
352
			return false;
-
 
353
		if (color == null) {
-
 
354
			if (other.color != null)
-
 
355
				return false;
-
 
356
		} else if (!color.equals(other.color))
-
 
357
			return false;
-
 
358
		if (damagedExpiryTimestamp == null) {
-
 
359
			if (other.damagedExpiryTimestamp != null)
-
 
360
				return false;
-
 
361
		} else if (!damagedExpiryTimestamp.equals(other.damagedExpiryTimestamp))
-
 
362
			return false;
-
 
363
		if (dealText == null) {
-
 
364
			if (other.dealText != null)
-
 
365
				return false;
-
 
366
		} else if (!dealText.equals(other.dealText))
-
 
367
			return false;
-
 
368
		if (extraInfo == null) {
-
 
369
			if (other.extraInfo != null)
-
 
370
				return false;
-
 
371
		} else if (!extraInfo.equals(other.extraInfo))
-
 
372
			return false;
-
 
373
		if (id == null) {
320
		if (id == null) {
374
			if (other.id != null)
321
			if (other.id != null)
375
				return false;
322
				return false;
376
		} else if (!id.equals(other.id))
323
		} else if (!id.equals(other.id))
377
			return false;
324
			return false;
378
		if (imeiNumber == null) {
-
 
379
			if (other.imeiNumber != null)
-
 
380
				return false;
-
 
381
		} else if (!imeiNumber.equals(other.imeiNumber))
-
 
382
			return false;
-
 
383
		if (item == null) {
-
 
384
			if (other.item != null)
-
 
385
				return false;
-
 
386
		} else if (!item.equals(other.item))
-
 
387
			return false;
-
 
388
		if (itemId == null) {
-
 
389
			if (other.itemId != null)
-
 
390
				return false;
-
 
391
		} else if (!itemId.equals(other.itemId))
-
 
392
			return false;
-
 
393
		if (itemNumber == null) {
-
 
394
			if (other.itemNumber != null)
-
 
395
				return false;
-
 
396
		} else if (!itemNumber.equals(other.itemNumber))
-
 
397
			return false;
-
 
398
		if (logisticsCost == null) {
-
 
399
			if (other.logisticsCost != null)
-
 
400
				return false;
-
 
401
		} else if (!logisticsCost.equals(other.logisticsCost))
-
 
402
			return false;
-
 
403
		if (modelName == null) {
-
 
404
			if (other.modelName != null)
-
 
405
				return false;
-
 
406
		} else if (!modelName.equals(other.modelName))
-
 
407
			return false;
-
 
408
		if (modelNumber == null) {
-
 
409
			if (other.modelNumber != null)
-
 
410
				return false;
-
 
411
		} else if (!modelNumber.equals(other.modelNumber))
-
 
412
			return false;
-
 
413
		if (mrp == null) {
-
 
414
			if (other.mrp != null)
-
 
415
				return false;
-
 
416
		} else if (!mrp.equals(other.mrp))
-
 
417
			return false;
-
 
418
		if (nlc == null) {
-
 
419
			if (other.nlc != null)
-
 
420
				return false;
-
 
421
		} else if (!nlc.equals(other.nlc))
-
 
422
			return false;
-
 
423
		if (orderId == null) {
-
 
424
			if (other.orderId != null)
-
 
425
				return false;
-
 
426
		} else if (!orderId.equals(other.orderId))
-
 
427
			return false;
-
 
428
		if (productGoup == null) {
-
 
429
			if (other.productGoup != null)
-
 
430
				return false;
-
 
431
		} else if (!productGoup.equals(other.productGoup))
-
 
432
			return false;
-
 
433
		if (quantity == null) {
-
 
434
			if (other.quantity != null)
-
 
435
				return false;
-
 
436
		} else if (!quantity.equals(other.quantity))
-
 
437
			return false;
-
 
438
		if (returnQty == null) {
-
 
439
			if (other.returnQty != null)
-
 
440
				return false;
-
 
441
		} else if (!returnQty.equals(other.returnQty))
-
 
442
			return false;
-
 
443
		if (serialNumber == null) {
-
 
444
			if (other.serialNumber != null)
-
 
445
				return false;
-
 
446
		} else if (!serialNumber.equals(other.serialNumber))
-
 
447
			return false;
-
 
448
		if (totalPrice == null) {
-
 
449
			if (other.totalPrice != null)
-
 
450
				return false;
-
 
451
		} else if (!totalPrice.equals(other.totalPrice))
-
 
452
			return false;
-
 
453
		if (totalWeight == null) {
-
 
454
			if (other.totalWeight != null)
-
 
455
				return false;
-
 
456
		} else if (!totalWeight.equals(other.totalWeight))
-
 
457
			return false;
-
 
458
		if (transferPrice == null) {
-
 
459
			if (other.transferPrice != null)
-
 
460
				return false;
-
 
461
		} else if (!transferPrice.equals(other.transferPrice))
-
 
462
			return false;
-
 
463
		if (unitPrice == null) {
-
 
464
			if (other.unitPrice != null)
-
 
465
				return false;
-
 
466
		} else if (!unitPrice.equals(other.unitPrice))
-
 
467
			return false;
-
 
468
		if (unitWeight == null) {
-
 
469
			if (other.unitWeight != null)
-
 
470
				return false;
-
 
471
		} else if (!unitWeight.equals(other.unitWeight))
-
 
472
			return false;
-
 
473
		if (vatRate == null) {
-
 
474
			if (other.vatRate != null)
-
 
475
				return false;
-
 
476
		} else if (!vatRate.equals(other.vatRate))
-
 
477
			return false;
-
 
478
		if (warrantyExpiryTimestamp == null) {
-
 
479
			if (other.warrantyExpiryTimestamp != null)
-
 
480
				return false;
-
 
481
		} else if (!warrantyExpiryTimestamp.equals(other.warrantyExpiryTimestamp))
-
 
482
			return false;
-
 
483
		return true;
325
		return true;
484
	}
326
	}
485
	@Override
327
	@Override
486
	public String toString() {
328
	public String toString() {
487
		return "LineItem [id=" + id + ", itemId=" + itemId + ", productGoup=" + productGoup + ", brand=" + brand
329
		return "LineItem [id=" + id + ", itemId=" + itemId + ", productGoup=" + productGoup + ", brand=" + brand