Subversion Repositories SmartDukaan

Rev

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

Rev 23509 Rev 23527
Line 1... Line 1...
1
package com.spice.profitmandi.dao.entity.fofo;
1
package com.spice.profitmandi.dao.entity.fofo;
2
 
2
 
3
import java.time.LocalDateTime;
3
import java.time.LocalDateTime;
4
import java.time.format.DateTimeFormatter;
4
import java.time.format.DateTimeFormatter;
5
import java.time.temporal.TemporalField;
-
 
6
 
5
 
7
import javax.persistence.CascadeType;
6
import javax.persistence.CascadeType;
8
import javax.persistence.Column;
7
import javax.persistence.Column;
9
import javax.persistence.Convert;
8
import javax.persistence.Convert;
10
import javax.persistence.Entity;
9
import javax.persistence.Entity;
Line 35... Line 34...
35
})
34
})
36
@Entity
35
@Entity
37
@Table(name="fofo.inventory_item", schema = "fofo")
36
@Table(name="fofo.inventory_item", schema = "fofo")
38
public class InventoryItem {
37
public class InventoryItem {
39
 
38
 
40
	public String getItemDescription() {
-
 
41
		return itemDescription;
-
 
42
	}
-
 
43
 
-
 
44
	public void setItemDescription(String itemDescription) {
-
 
45
		this.itemDescription = itemDescription;
-
 
46
	}
-
 
47
 
-
 
48
	public void setUnitPrice(float unitPrice) {
-
 
49
		this.unitPrice = unitPrice;
-
 
50
	}
-
 
51
 
-
 
52
	@Id
39
	@Id
53
	@Column(name="id", unique=true, updatable=false)
40
	@Column(name="id", unique=true, updatable=false)
54
	@GeneratedValue(strategy = GenerationType.IDENTITY)
41
	@GeneratedValue(strategy = GenerationType.IDENTITY)
55
	private int id;
42
	private int id;
56
	
43
	
Line 69... Line 56...
69
	@Column(name = "good_quantity")
56
	@Column(name = "good_quantity")
70
	private int goodQuantity; 
57
	private int goodQuantity; 
71
	
58
	
72
	@Column(name = "bad_quantity")
59
	@Column(name = "bad_quantity")
73
	private int badQuantity;
60
	private int badQuantity;
74
 
-
 
75
	
-
 
76
	@Transient
-
 
77
	private String itemDescription;
-
 
78
	
61
	
79
	@Column(name = "last_scan_type")
62
	@Column(name = "last_scan_type")
80
	@Enumerated(EnumType.STRING)
63
	@Enumerated(EnumType.STRING)
81
	private ScanType lastScanType;
64
	private ScanType lastScanType;
82
	
65
	
Line 118... Line 101...
118
	private Item item;
101
	private Item item;
119
	
102
	
120
	@OneToOne(cascade=CascadeType.ALL,fetch=FetchType.LAZY)
103
	@OneToOne(cascade=CascadeType.ALL,fetch=FetchType.LAZY)
121
	@JoinColumn(name="purchase_id",insertable=false,updatable=false,nullable=false, referencedColumnName = "id")
104
	@JoinColumn(name="purchase_id",insertable=false,updatable=false,nullable=false, referencedColumnName = "id")
122
	private Purchase purchase;
105
	private Purchase purchase;
-
 
106
	
-
 
107
	@Transient
-
 
108
	private String itemDescription;
123
 
109
 
124
	public int getId() {
110
	public int getId() {
125
		return id;
111
		return id;
126
	}
112
	}
127
 
113
 
Line 236... Line 222...
236
	}
222
	}
237
 
223
 
238
	public LocalDateTime getCreateTimestamp() {
224
	public LocalDateTime getCreateTimestamp() {
239
		return createTimestamp;
225
		return createTimestamp;
240
	}
226
	}
241
	
-
 
242
 
227
 
243
	public void setCreateTimestamp(LocalDateTime createTimestamp) {
228
	public void setCreateTimestamp(LocalDateTime createTimestamp) {
244
		this.createTimestamp = createTimestamp;
229
		this.createTimestamp = createTimestamp;
245
	}
230
	}
246
	
231
	
247
	public String getFormattedCreateTimestamp(){
-
 
248
		if(createTimestamp == null){
-
 
249
			return null;
-
 
250
		}
-
 
251
		DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-YYYY HH:mm");
-
 
252
		return createTimestamp.format(formatter);
-
 
253
    }
-
 
254
	
-
 
255
	public LocalDateTime getUpdateTimestamp() {
232
	public LocalDateTime getUpdateTimestamp() {
256
		return updateTimestamp;
233
		return updateTimestamp;
257
	}
234
	}
258
	public void setUpdateTimestamp(LocalDateTime updateTimestamp) {
235
	public void setUpdateTimestamp(LocalDateTime updateTimestamp) {
259
		this.updateTimestamp = updateTimestamp;
236
		this.updateTimestamp = updateTimestamp;
Line 280... Line 257...
280
	
257
	
281
	public void setPurchase(Purchase purchase) {
258
	public void setPurchase(Purchase purchase) {
282
		this.purchase = purchase;
259
		this.purchase = purchase;
283
	}
260
	}
284
	
261
	
-
 
262
	public String getFormattedCreateTimestamp(){
-
 
263
		if(createTimestamp == null){
-
 
264
			return null;
-
 
265
		}
-
 
266
		DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-YYYY HH:mm");
-
 
267
		return createTimestamp.format(formatter);
-
 
268
    }
-
 
269
	
-
 
270
	public String getItemDescription() {
-
 
271
		return itemDescription;
-
 
272
	}
-
 
273
	
-
 
274
	public void setItemDescription(String itemDescription) {
-
 
275
		this.itemDescription = itemDescription;
-
 
276
	}
-
 
277
	
285
	@Override
278
	@Override
286
	public int hashCode() {
279
	public int hashCode() {
287
		final int prime = 31;
280
		final int prime = 31;
288
		int result = 1;
281
		int result = 1;
289
		result = prime * result + id;
282
		result = prime * result + id;