Subversion Repositories SmartDukaan

Rev

Rev 23968 | Rev 24671 | 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
50
	private String serialNumber;
51
 
52
	@Transient
53
	private String storeCode;
54
 
55
	@Transient
56
	private SchemeType schemeType;
23509 amit.gupta 57
 
24592 amit.gupta 58
	public String getStoreCode() {
59
		return storeCode;
60
	}
61
 
62
	public void setStoreCode(String storeCode) {
63
		this.storeCode = storeCode;
64
	}
65
 
66
	public SchemeType getSchemeType() {
67
		return schemeType;
68
	}
69
 
70
	public void setSchemeType(SchemeType schemeType) {
71
		this.schemeType = schemeType;
72
	}
73
 
74
	public String getSerialNumber() {
75
		return serialNumber;
76
	}
77
 
78
	public void setSerialNumber(String serialNumber) {
79
		this.serialNumber = serialNumber;
80
	}
81
 
22859 ashik.ali 82
	public int getSchemeId() {
83
		return schemeId;
22653 ashik.ali 84
	}
24592 amit.gupta 85
 
22859 ashik.ali 86
	public void setSchemeId(int schemeId) {
87
		this.schemeId = schemeId;
22653 ashik.ali 88
	}
24592 amit.gupta 89
 
22859 ashik.ali 90
	public int getInventoryItemId() {
91
		return inventoryItemId;
92
	}
24592 amit.gupta 93
 
22859 ashik.ali 94
	public void setInventoryItemId(int inventoryItemId) {
95
		this.inventoryItemId = inventoryItemId;
96
	}
24592 amit.gupta 97
 
22653 ashik.ali 98
	public float getAmount() {
99
		return amount;
100
	}
24592 amit.gupta 101
 
22653 ashik.ali 102
	public void setAmount(float amount) {
103
		this.amount = amount;
104
	}
24592 amit.gupta 105
 
23339 ashik.ali 106
	public LocalDateTime getCreateTimestamp() {
107
		return createTimestamp;
108
	}
24592 amit.gupta 109
 
23339 ashik.ali 110
	public void setCreateTimestamp(LocalDateTime createTimestamp) {
111
		this.createTimestamp = createTimestamp;
112
	}
24592 amit.gupta 113
 
23527 ashik.ali 114
	public LocalDateTime getRolledBackTimestamp() {
115
		return rolledBackTimestamp;
116
	}
24592 amit.gupta 117
 
23527 ashik.ali 118
	public void setRolledBackTimestamp(LocalDateTime rolledBackTimestamp) {
119
		this.rolledBackTimestamp = rolledBackTimestamp;
120
	}
22859 ashik.ali 121
 
22653 ashik.ali 122
	@Override
123
	public int hashCode() {
124
		final int prime = 31;
125
		int result = 1;
22859 ashik.ali 126
		result = prime * result + Float.floatToIntBits(amount);
23339 ashik.ali 127
		result = prime * result + ((createTimestamp == null) ? 0 : createTimestamp.hashCode());
24592 amit.gupta 128
		result = prime * result + id;
22859 ashik.ali 129
		result = prime * result + inventoryItemId;
24592 amit.gupta 130
		result = prime * result + ((rolledBackTimestamp == null) ? 0 : rolledBackTimestamp.hashCode());
22859 ashik.ali 131
		result = prime * result + schemeId;
24592 amit.gupta 132
		result = prime * result + ((schemeType == null) ? 0 : schemeType.hashCode());
133
		result = prime * result + ((serialNumber == null) ? 0 : serialNumber.hashCode());
22653 ashik.ali 134
		return result;
135
	}
22859 ashik.ali 136
 
22653 ashik.ali 137
	@Override
138
	public boolean equals(Object obj) {
139
		if (this == obj)
140
			return true;
141
		if (obj == null)
142
			return false;
143
		if (getClass() != obj.getClass())
144
			return false;
22859 ashik.ali 145
		SchemeInOut other = (SchemeInOut) obj;
146
		if (Float.floatToIntBits(amount) != Float.floatToIntBits(other.amount))
22653 ashik.ali 147
			return false;
23339 ashik.ali 148
		if (createTimestamp == null) {
149
			if (other.createTimestamp != null)
150
				return false;
151
		} else if (!createTimestamp.equals(other.createTimestamp))
152
			return false;
24592 amit.gupta 153
		if (id != other.id)
154
			return false;
22859 ashik.ali 155
		if (inventoryItemId != other.inventoryItemId)
156
			return false;
24592 amit.gupta 157
		if (rolledBackTimestamp == null) {
158
			if (other.rolledBackTimestamp != null)
159
				return false;
160
		} else if (!rolledBackTimestamp.equals(other.rolledBackTimestamp))
161
			return false;
22859 ashik.ali 162
		if (schemeId != other.schemeId)
163
			return false;
24592 amit.gupta 164
		if (schemeType != other.schemeType)
165
			return false;
166
		if (serialNumber == null) {
167
			if (other.serialNumber != null)
168
				return false;
169
		} else if (!serialNumber.equals(other.serialNumber))
170
			return false;
22653 ashik.ali 171
		return true;
172
	}
173
 
174
	@Override
175
	public String toString() {
24592 amit.gupta 176
		return "SchemeInOut [id=" + id + ", schemeId=" + schemeId + ", inventoryItemId=" + inventoryItemId + ", amount="
177
				+ amount + ", createTimestamp=" + createTimestamp + ", rolledBackTimestamp=" + rolledBackTimestamp
178
				+ ", serialNumber=" + serialNumber + ", storeCode=" + storeCode + ", schemeType=" + schemeType + "]";
22653 ashik.ali 179
	}
24592 amit.gupta 180
 
22653 ashik.ali 181
}