Subversion Repositories SmartDukaan

Rev

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

Rev 21924 Rev 22009
Line 2... Line 2...
2
 
2
 
3
import java.io.Serializable;
3
import java.io.Serializable;
4
import java.time.LocalDateTime;
4
import java.time.LocalDateTime;
5
 
5
 
6
import javax.persistence.Column;
6
import javax.persistence.Column;
-
 
7
import javax.persistence.Convert;
7
import javax.persistence.Entity;
8
import javax.persistence.Entity;
8
import javax.persistence.GeneratedValue;
9
import javax.persistence.GeneratedValue;
9
import javax.persistence.GenerationType;
10
import javax.persistence.GenerationType;
10
import javax.persistence.Id;
11
import javax.persistence.Id;
11
import javax.persistence.NamedQueries;
12
import javax.persistence.NamedQueries;
12
import javax.persistence.NamedQuery;
13
import javax.persistence.NamedQuery;
13
import javax.persistence.Table;
14
import javax.persistence.Table;
14
import javax.persistence.UniqueConstraint;
15
import javax.persistence.UniqueConstraint;
15
 
16
 
-
 
17
import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;
-
 
18
 
16
/**
19
/**
17
 * This class basically contains address details
20
 * This class basically contains address details
18
 * 
21
 * 
19
 * @author ashikali
22
 * @author ashikali
20
 *
23
 *
Line 72... Line 75...
72
	private boolean enabled;
75
	private boolean enabled;
73
 
76
 
74
	@Column(name = "user_id")
77
	@Column(name = "user_id")
75
	private int retailerId;
78
	private int retailerId;
76
	
79
	
-
 
80
	@Convert(converter = LocalDateTimeAttributeConverter.class)
77
	@Column(name="added_on", updatable = false)
81
	@Column(name="added_on", updatable = false)
78
	private LocalDateTime createTimestamp = LocalDateTime.now();
82
	private LocalDateTime createTimestamp = LocalDateTime.now();
79
	
83
	
-
 
84
	@Convert(converter = LocalDateTimeAttributeConverter.class)
80
	@Column(name="update_timestamp")
85
	@Column(name="update_timestamp")
81
	private LocalDateTime updateTimestamp = LocalDateTime.now();
86
	private LocalDateTime updateTimestamp = LocalDateTime.now();
82
	
87
	
83
	public int getId() {
88
	public int getId() {
84
		return id;
89
		return id;
Line 167... Line 172...
167
	public void setRetaierId(int retailerId) {
172
	public void setRetaierId(int retailerId) {
168
		this.retailerId = retailerId;
173
		this.retailerId = retailerId;
169
	}
174
	}
170
	
175
	
171
	
176
	
-
 
177
	
172
	@Override
178
	@Override
173
	public int hashCode() {
179
	public int hashCode() {
174
		final int prime = 31;
180
		final int prime = 31;
175
		int result = 1;
181
		int result = 1;
176
		result = prime * result + ((city == null) ? 0 : city.hashCode());
-
 
177
		result = prime * result + ((country == null) ? 0 : country.hashCode());
-
 
178
		result = prime * result + ((createTimestamp == null) ? 0 : createTimestamp.hashCode());
-
 
179
		result = prime * result + (enabled ? 1231 : 1237);
-
 
180
		result = prime * result + id;
182
		result = prime * result + id;
181
		result = prime * result + ((landmark == null) ? 0 : landmark.hashCode());
-
 
182
		result = prime * result + ((line1 == null) ? 0 : line1.hashCode());
-
 
183
		result = prime * result + ((line2 == null) ? 0 : line2.hashCode());
-
 
184
		result = prime * result + ((name == null) ? 0 : name.hashCode());
-
 
185
		result = prime * result + ((phoneNumber == null) ? 0 : phoneNumber.hashCode());
-
 
186
		result = prime * result + ((pinCode == null) ? 0 : pinCode.hashCode());
-
 
187
		result = prime * result + retailerId;
-
 
188
		result = prime * result + ((state == null) ? 0 : state.hashCode());
-
 
189
		result = prime * result + ((updateTimestamp == null) ? 0 : updateTimestamp.hashCode());
-
 
190
		return result;
183
		return result;
191
	}
184
	}
192
	@Override
185
	@Override
193
	public boolean equals(Object obj) {
186
	public boolean equals(Object obj) {
194
		if (this == obj)
187
		if (this == obj)
Line 196... Line 189...
196
		if (obj == null)
189
		if (obj == null)
197
			return false;
190
			return false;
198
		if (getClass() != obj.getClass())
191
		if (getClass() != obj.getClass())
199
			return false;
192
			return false;
200
		Address other = (Address) obj;
193
		Address other = (Address) obj;
201
		if (city == null) {
-
 
202
			if (other.city != null)
-
 
203
				return false;
-
 
204
		} else if (!city.equals(other.city))
-
 
205
			return false;
-
 
206
		if (country == null) {
-
 
207
			if (other.country != null)
-
 
208
				return false;
-
 
209
		} else if (!country.equals(other.country))
-
 
210
			return false;
-
 
211
		if (createTimestamp == null) {
-
 
212
			if (other.createTimestamp != null)
-
 
213
				return false;
-
 
214
		} else if (!createTimestamp.equals(other.createTimestamp))
-
 
215
			return false;
-
 
216
		if (enabled != other.enabled)
-
 
217
			return false;
-
 
218
		if (id != other.id)
194
		if (id != other.id)
219
			return false;
195
			return false;
220
		if (landmark == null) {
-
 
221
			if (other.landmark != null)
-
 
222
				return false;
-
 
223
		} else if (!landmark.equals(other.landmark))
-
 
224
			return false;
-
 
225
		if (line1 == null) {
-
 
226
			if (other.line1 != null)
-
 
227
				return false;
-
 
228
		} else if (!line1.equals(other.line1))
-
 
229
			return false;
-
 
230
		if (line2 == null) {
-
 
231
			if (other.line2 != null)
-
 
232
				return false;
-
 
233
		} else if (!line2.equals(other.line2))
-
 
234
			return false;
-
 
235
		if (name == null) {
-
 
236
			if (other.name != null)
-
 
237
				return false;
-
 
238
		} else if (!name.equals(other.name))
-
 
239
			return false;
-
 
240
		if (phoneNumber == null) {
-
 
241
			if (other.phoneNumber != null)
-
 
242
				return false;
-
 
243
		} else if (!phoneNumber.equals(other.phoneNumber))
-
 
244
			return false;
-
 
245
		if (pinCode == null) {
-
 
246
			if (other.pinCode != null)
-
 
247
				return false;
-
 
248
		} else if (!pinCode.equals(other.pinCode))
-
 
249
			return false;
-
 
250
		if (retailerId != other.retailerId)
-
 
251
			return false;
-
 
252
		if (state == null) {
-
 
253
			if (other.state != null)
-
 
254
				return false;
-
 
255
		} else if (!state.equals(other.state))
-
 
256
			return false;
-
 
257
		if (updateTimestamp == null) {
-
 
258
			if (other.updateTimestamp != null)
-
 
259
				return false;
-
 
260
		} else if (!updateTimestamp.equals(other.updateTimestamp))
-
 
261
			return false;
-
 
262
		return true;
196
		return true;
263
	}
197
	}
264
	@Override
198
	@Override
265
	public String toString() {
199
	public String toString() {
266
		return "Address [id=" + id + ", name=" + name + ", line1=" + line1 + ", line2=" + line2 + ", landmark="
200
		return "Address [id=" + id + ", name=" + name + ", line1=" + line1 + ", line2=" + line2 + ", landmark="