Subversion Repositories SmartDukaan

Rev

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

Rev 21984 Rev 22009
Line 44... Line 44...
44
	
44
	
45
})
45
})
46
@Entity
46
@Entity
47
@Table(name="fofo.inventory_item", schema = "fofo")
47
@Table(name="fofo.inventory_item", schema = "fofo")
48
public class InventoryItem {
48
public class InventoryItem {
49
	
-
 
50
	@Override
-
 
51
	public int hashCode() {
-
 
52
		final int prime = 31;
-
 
53
		int result = 1;
-
 
54
		result = prime * result + badQuantity;
-
 
55
		result = prime * result + ((createTimestamp == null) ? 0 : createTimestamp.hashCode());
-
 
56
		result = prime * result + fofoId;
-
 
57
		result = prime * result + goodQuantity;
-
 
58
		result = prime * result + id;
-
 
59
		result = prime * result + initialQuantity;
-
 
60
		result = prime * result + ((item == null) ? 0 : item.hashCode());
-
 
61
		result = prime * result + itemId;
-
 
62
		result = prime * result + ((lastScanType == null) ? 0 : lastScanType.hashCode());
-
 
63
		result = prime * result + ((priceDropAmount == null) ? 0 : priceDropAmount.hashCode());
-
 
64
		result = prime * result + purchaseId;
-
 
65
		result = prime * result + ((serialNumber == null) ? 0 : serialNumber.hashCode());
-
 
66
		result = prime * result + ((unitPrice == null) ? 0 : unitPrice.hashCode());
-
 
67
		result = prime * result + ((updateTimestamp == null) ? 0 : updateTimestamp.hashCode());
-
 
68
		return result;
-
 
69
	}
-
 
70
 
-
 
71
	@Override
-
 
72
	public boolean equals(Object obj) {
-
 
73
		if (this == obj)
-
 
74
			return true;
-
 
75
		if (obj == null)
-
 
76
			return false;
-
 
77
		if (getClass() != obj.getClass())
-
 
78
			return false;
-
 
79
		InventoryItem other = (InventoryItem) obj;
-
 
80
		if (badQuantity != other.badQuantity)
-
 
81
			return false;
-
 
82
		if (createTimestamp == null) {
-
 
83
			if (other.createTimestamp != null)
-
 
84
				return false;
-
 
85
		} else if (!createTimestamp.equals(other.createTimestamp))
-
 
86
			return false;
-
 
87
		if (fofoId != other.fofoId)
-
 
88
			return false;
-
 
89
		if (goodQuantity != other.goodQuantity)
-
 
90
			return false;
-
 
91
		if (id != other.id)
-
 
92
			return false;
-
 
93
		if (initialQuantity != other.initialQuantity)
-
 
94
			return false;
-
 
95
		if (item == null) {
-
 
96
			if (other.item != null)
-
 
97
				return false;
-
 
98
		} else if (!item.equals(other.item))
-
 
99
			return false;
-
 
100
		if (itemId != other.itemId)
-
 
101
			return false;
-
 
102
		if (lastScanType != other.lastScanType)
-
 
103
			return false;
-
 
104
		if (priceDropAmount == null) {
-
 
105
			if (other.priceDropAmount != null)
-
 
106
				return false;
-
 
107
		} else if (!priceDropAmount.equals(other.priceDropAmount))
-
 
108
			return false;
-
 
109
		if (purchaseId != other.purchaseId)
-
 
110
			return false;
-
 
111
		if (serialNumber == null) {
-
 
112
			if (other.serialNumber != null)
-
 
113
				return false;
-
 
114
		} else if (!serialNumber.equals(other.serialNumber))
-
 
115
			return false;
-
 
116
		if (unitPrice == null) {
-
 
117
			if (other.unitPrice != null)
-
 
118
				return false;
-
 
119
		} else if (!unitPrice.equals(other.unitPrice))
-
 
120
			return false;
-
 
121
		if (updateTimestamp == null) {
-
 
122
			if (other.updateTimestamp != null)
-
 
123
				return false;
-
 
124
		} else if (!updateTimestamp.equals(other.updateTimestamp))
-
 
125
			return false;
-
 
126
		return true;
-
 
127
	}
-
 
128
 
49
 
129
	@Id
50
	@Id
130
	@Column(name="id", unique=true, updatable=false)
51
	@Column(name="id", unique=true, updatable=false)
131
	@GeneratedValue(strategy = GenerationType.IDENTITY)
52
	@GeneratedValue(strategy = GenerationType.IDENTITY)
132
	private int id;
53
	private int id;
Line 279... Line 200...
279
	}
200
	}
280
	public void setItem(Item item) {
201
	public void setItem(Item item) {
281
		this.item = item;
202
		this.item = item;
282
	}
203
	}
283
 
204
 
-
 
205
	
-
 
206
	@Override
-
 
207
	public int hashCode() {
-
 
208
		final int prime = 31;
-
 
209
		int result = 1;
-
 
210
		result = prime * result + id;
-
 
211
		return result;
-
 
212
	}
-
 
213
 
-
 
214
	@Override
-
 
215
	public boolean equals(Object obj) {
-
 
216
		if (this == obj)
-
 
217
			return true;
-
 
218
		if (obj == null)
-
 
219
			return false;
-
 
220
		if (getClass() != obj.getClass())
-
 
221
			return false;
-
 
222
		InventoryItem other = (InventoryItem) obj;
-
 
223
		if (id != other.id)
-
 
224
			return false;
-
 
225
		return true;
-
 
226
	}
-
 
227
 
284
	@Override
228
	@Override
285
	public String toString() {
229
	public String toString() {
286
		return "InventoryItem [id=" + id + ", itemId=" + itemId + ", fofoId=" + fofoId + ", serialNumber="
230
		return "InventoryItem [id=" + id + ", itemId=" + itemId + ", fofoId=" + fofoId + ", serialNumber="
287
				+ serialNumber + ", initialQuantity=" + initialQuantity + ", goodQuantity=" + goodQuantity
231
				+ serialNumber + ", initialQuantity=" + initialQuantity + ", goodQuantity=" + goodQuantity
288
				+ ", badQuantity=" + badQuantity + ", lastScanType=" + lastScanType + ", purchaseId=" + purchaseId
232
				+ ", badQuantity=" + badQuantity + ", lastScanType=" + lastScanType + ", purchaseId=" + purchaseId
289
				+ ", unitPrice=" + unitPrice + ", priceDropAmount=" + priceDropAmount + ", createTimestamp="
233
				+ ", unitPrice=" + unitPrice + ", priceDropAmount=" + priceDropAmount + ", createTimestamp="
290
				+ createTimestamp + ", updateTimestamp=" + updateTimestamp + ", item=" + item + "]";
234
				+ createTimestamp + ", updateTimestamp=" + updateTimestamp + ", item=" + item + "]";
291
	}
235
	}
292
 
-
 
293
	
-
 
294
	
-
 
295
	
-
 
296
	
236
	
297
}
237
}