Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
22653 ashik.ali 1
package com.spice.profitmandi.dao.entity.fofo;
2
 
3
import java.io.Serializable;
23339 ashik.ali 4
import java.time.LocalDateTime;
22653 ashik.ali 5
 
6
import javax.persistence.Column;
7
import javax.persistence.Entity;
23968 amit.gupta 8
import javax.persistence.GeneratedValue;
9
import javax.persistence.GenerationType;
22653 ashik.ali 10
import javax.persistence.Id;
11
import javax.persistence.Table;
24592 amit.gupta 12
import javax.persistence.Transient;
22653 ashik.ali 13
 
24592 amit.gupta 14
import com.spice.profitmandi.dao.enumuration.catalog.SchemeType;
15
 
22653 ashik.ali 16
@Entity
24592 amit.gupta 17
@Table(name = "fofo.scheme_in_out", schema = "fofo")
18
public class SchemeInOut implements Serializable {	
19
 
20
	public SchemeInOut(int schemeId, int inventoryItemId) {
21
		this.schemeId = schemeId;
22
		this.inventoryItemId = inventoryItemId;
23
	}
22653 ashik.ali 24
 
24592 amit.gupta 25
	public SchemeInOut() {
26
	}
27
 
22653 ashik.ali 28
	private static final long serialVersionUID = 1L;
24592 amit.gupta 29
 
22859 ashik.ali 30
	@Id
23968 amit.gupta 31
	@GeneratedValue(strategy = GenerationType.IDENTITY)
32
	private int id;
24592 amit.gupta 33
 
22859 ashik.ali 34
	@Column(name = "scheme_id")
35
	private int schemeId;
22653 ashik.ali 36
 
22859 ashik.ali 37
	@Column(name = "inventory_item_id")
38
	private int inventoryItemId;
24592 amit.gupta 39
 
22653 ashik.ali 40
	@Column(name = "amount")
41
	private float amount;
24592 amit.gupta 42
 
23345 ashik.ali 43
	@Column(name = "create_timestamp")
23339 ashik.ali 44
	private LocalDateTime createTimestamp = LocalDateTime.now();
24592 amit.gupta 45
 
23509 amit.gupta 46
	@Column(name = "rolled_back_timestamp")
23527 ashik.ali 47
	private LocalDateTime rolledBackTimestamp;
24592 amit.gupta 48
 
49
	@Transient
24671 amit.gupta 50
	private int reference;
51
	public int getReference() {
52
		return reference;
53
	}
54
 
55
	public void setReference(int reference) {
56
		this.reference = reference;
57
	}
58
 
59
	@Transient
24592 amit.gupta 60
	private String serialNumber;
61
 
62
	@Transient
63
	private String storeCode;
64
 
65
	@Transient
66
	private SchemeType schemeType;
23509 amit.gupta 67
 
24592 amit.gupta 68
	public String getStoreCode() {
69
		return storeCode;
70
	}
71
 
72
	public void setStoreCode(String storeCode) {
73
		this.storeCode = storeCode;
74
	}
75
 
76
	public SchemeType getSchemeType() {
77
		return schemeType;
78
	}
79
 
80
	public void setSchemeType(SchemeType schemeType) {
81
		this.schemeType = schemeType;
82
	}
83
 
84
	public String getSerialNumber() {
85
		return serialNumber;
86
	}
87
 
88
	public void setSerialNumber(String serialNumber) {
89
		this.serialNumber = serialNumber;
90
	}
91
 
22859 ashik.ali 92
	public int getSchemeId() {
93
		return schemeId;
22653 ashik.ali 94
	}
24592 amit.gupta 95
 
22859 ashik.ali 96
	public void setSchemeId(int schemeId) {
97
		this.schemeId = schemeId;
22653 ashik.ali 98
	}
24592 amit.gupta 99
 
22859 ashik.ali 100
	public int getInventoryItemId() {
101
		return inventoryItemId;
102
	}
24592 amit.gupta 103
 
22859 ashik.ali 104
	public void setInventoryItemId(int inventoryItemId) {
105
		this.inventoryItemId = inventoryItemId;
106
	}
24592 amit.gupta 107
 
22653 ashik.ali 108
	public float getAmount() {
109
		return amount;
110
	}
24592 amit.gupta 111
 
22653 ashik.ali 112
	public void setAmount(float amount) {
113
		this.amount = amount;
114
	}
24592 amit.gupta 115
 
23339 ashik.ali 116
	public LocalDateTime getCreateTimestamp() {
117
		return createTimestamp;
118
	}
24592 amit.gupta 119
 
23339 ashik.ali 120
	public void setCreateTimestamp(LocalDateTime createTimestamp) {
121
		this.createTimestamp = createTimestamp;
122
	}
24592 amit.gupta 123
 
23527 ashik.ali 124
	public LocalDateTime getRolledBackTimestamp() {
125
		return rolledBackTimestamp;
126
	}
24592 amit.gupta 127
 
23527 ashik.ali 128
	public void setRolledBackTimestamp(LocalDateTime rolledBackTimestamp) {
129
		this.rolledBackTimestamp = rolledBackTimestamp;
130
	}
22859 ashik.ali 131
 
22653 ashik.ali 132
	@Override
133
	public int hashCode() {
134
		final int prime = 31;
135
		int result = 1;
22859 ashik.ali 136
		result = prime * result + Float.floatToIntBits(amount);
23339 ashik.ali 137
		result = prime * result + ((createTimestamp == null) ? 0 : createTimestamp.hashCode());
24592 amit.gupta 138
		result = prime * result + id;
22859 ashik.ali 139
		result = prime * result + inventoryItemId;
24592 amit.gupta 140
		result = prime * result + ((rolledBackTimestamp == null) ? 0 : rolledBackTimestamp.hashCode());
22859 ashik.ali 141
		result = prime * result + schemeId;
24592 amit.gupta 142
		result = prime * result + ((schemeType == null) ? 0 : schemeType.hashCode());
143
		result = prime * result + ((serialNumber == null) ? 0 : serialNumber.hashCode());
22653 ashik.ali 144
		return result;
145
	}
22859 ashik.ali 146
 
22653 ashik.ali 147
	@Override
148
	public boolean equals(Object obj) {
149
		if (this == obj)
150
			return true;
151
		if (obj == null)
152
			return false;
153
		if (getClass() != obj.getClass())
154
			return false;
22859 ashik.ali 155
		SchemeInOut other = (SchemeInOut) obj;
156
		if (Float.floatToIntBits(amount) != Float.floatToIntBits(other.amount))
22653 ashik.ali 157
			return false;
23339 ashik.ali 158
		if (createTimestamp == null) {
159
			if (other.createTimestamp != null)
160
				return false;
161
		} else if (!createTimestamp.equals(other.createTimestamp))
162
			return false;
24592 amit.gupta 163
		if (id != other.id)
164
			return false;
22859 ashik.ali 165
		if (inventoryItemId != other.inventoryItemId)
166
			return false;
24592 amit.gupta 167
		if (rolledBackTimestamp == null) {
168
			if (other.rolledBackTimestamp != null)
169
				return false;
170
		} else if (!rolledBackTimestamp.equals(other.rolledBackTimestamp))
171
			return false;
22859 ashik.ali 172
		if (schemeId != other.schemeId)
173
			return false;
24592 amit.gupta 174
		if (schemeType != other.schemeType)
175
			return false;
176
		if (serialNumber == null) {
177
			if (other.serialNumber != null)
178
				return false;
179
		} else if (!serialNumber.equals(other.serialNumber))
180
			return false;
22653 ashik.ali 181
		return true;
182
	}
183
 
184
	@Override
185
	public String toString() {
24592 amit.gupta 186
		return "SchemeInOut [id=" + id + ", schemeId=" + schemeId + ", inventoryItemId=" + inventoryItemId + ", amount="
187
				+ amount + ", createTimestamp=" + createTimestamp + ", rolledBackTimestamp=" + rolledBackTimestamp
188
				+ ", serialNumber=" + serialNumber + ", storeCode=" + storeCode + ", schemeType=" + schemeType + "]";
22653 ashik.ali 189
	}
24592 amit.gupta 190
 
22653 ashik.ali 191
}