Subversion Repositories SmartDukaan

Rev

Rev 21924 | Rev 22522 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
21714 ashik.ali 1
package com.spice.profitmandi.dao.entity.fofo;
21552 ashik.ali 2
 
3
import java.time.LocalDateTime;
4
 
5
import javax.persistence.Column;
21633 ashik.ali 6
import javax.persistence.Convert;
21552 ashik.ali 7
import javax.persistence.Entity;
8
import javax.persistence.EnumType;
9
import javax.persistence.Enumerated;
10
import javax.persistence.GeneratedValue;
11
import javax.persistence.GenerationType;
12
import javax.persistence.Id;
13
import javax.persistence.NamedQueries;
14
import javax.persistence.NamedQuery;
15
import javax.persistence.Table;
16
 
21633 ashik.ali 17
import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;
21714 ashik.ali 18
import com.spice.profitmandi.dao.enumuration.fofo.ScanType;
21552 ashik.ali 19
 
20
@Entity
21
@Table(name="fofo.scan_record", schema = "fofo")
22
@NamedQueries({
23
	@NamedQuery(name = "ScanRecord.selectCount", query = "select count(sr) from ScanRecord sr"),
24
	@NamedQuery(name = "ScanRecord.selectByFofoId", query = "select sr from ScanRecord sr where sr.fofoId = :fofoId")
25
})
26
public class ScanRecord {
27
 
28
	@Id
29
	@Column(name="id", unique=true, updatable=false)
30
	@GeneratedValue(strategy = GenerationType.IDENTITY)
31
	private int id;
32
 
33
	@Column(name = "fofo_id")
34
	private int fofoId;
35
 
21573 ashik.ali 36
	@Column(name = "inventory_item_id")
37
	private int inventoryItemId;
38
 
39
	@Column(name = "quantity")
40
	private int quantity;
41
 
21552 ashik.ali 42
	@Column(name = "type")
43
	@Enumerated(EnumType.STRING)
44
	private ScanType type;
45
 
21633 ashik.ali 46
	@Convert(converter = LocalDateTimeAttributeConverter.class)
21552 ashik.ali 47
	@Column(name = "create_timestamp")
21633 ashik.ali 48
	private LocalDateTime createTimestamp = LocalDateTime.now();
21552 ashik.ali 49
 
50
	public int getId() {
51
		return id;
52
	}
53
 
54
	public void setId(int id) {
55
		this.id = id;
56
	}
57
 
58
	public int getFofoId() {
59
		return fofoId;
60
	}
61
 
62
	public void setFofoId(int fofoId) {
63
		this.fofoId = fofoId;
64
	}
21573 ashik.ali 65
 
66
	public int getInventoryItemId() {
67
		return inventoryItemId;
68
	}
69
	public void setInventoryItemId(int inventoryItemId) {
70
		this.inventoryItemId = inventoryItemId;
71
	}
72
 
73
	public int getQuantity() {
74
		return quantity;
75
	}
76
	public void setQuantity(int quantity) {
77
		this.quantity = quantity;
78
	}
21552 ashik.ali 79
 
80
	public ScanType getType() {
81
		return type;
82
	}
83
 
84
	public void setType(ScanType type) {
85
		this.type = type;
86
	}
87
 
88
	public LocalDateTime getCreateTimestamp() {
89
		return createTimestamp;
90
	}
91
	public void setCreateTimestamp(LocalDateTime createTimestamp) {
92
		this.createTimestamp = createTimestamp;
93
	}
21924 ashik.ali 94
 
21602 ashik.ali 95
 
96
	@Override
21924 ashik.ali 97
	public int hashCode() {
98
		final int prime = 31;
99
		int result = 1;
100
		result = prime * result + id;
101
		return result;
102
	}
103
 
104
	@Override
105
	public boolean equals(Object obj) {
106
		if (this == obj)
107
			return true;
108
		if (obj == null)
109
			return false;
110
		if (getClass() != obj.getClass())
111
			return false;
112
		ScanRecord other = (ScanRecord) obj;
113
		if (id != other.id)
114
			return false;
115
		return true;
116
	}
117
 
118
	@Override
21602 ashik.ali 119
	public String toString() {
120
		return "ScanRecord [id=" + id + ", fofoId=" + fofoId + ", inventoryItemId=" + inventoryItemId + ", quantity="
121
				+ quantity + ", type=" + type + ", createTimestamp=" + createTimestamp + "]";
122
	}
123
 
124
 
21573 ashik.ali 125
 
126
}