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.Table;
12
import javax.persistence.Table;
12
 
13
 
-
 
14
import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;
-
 
15
 
13
/**
16
/**
14
 * This class basically contains address details
17
 * This class basically contains address details
15
 * 
18
 * 
16
 * @author ashikali
19
 * @author ashikali
17
 *
20
 *
Line 58... Line 61...
58
	private String phoneNumber;
61
	private String phoneNumber;
59
	
62
	
60
	@Column(name = "customer_id")
63
	@Column(name = "customer_id")
61
	private int customerId;
64
	private int customerId;
62
	
65
	
-
 
66
	@Convert(converter = LocalDateTimeAttributeConverter.class)
63
	@Column(name="create_timestamp", updatable = false)
67
	@Column(name="create_timestamp", updatable = false)
64
	private LocalDateTime createTimestamp = LocalDateTime.now();
68
	private LocalDateTime createTimestamp = LocalDateTime.now();
65
	
69
	
-
 
70
	@Convert(converter = LocalDateTimeAttributeConverter.class)
66
	@Column(name="update_timestamp")
71
	@Column(name="update_timestamp")
67
	private LocalDateTime updateTimestamp = LocalDateTime.now();
72
	private LocalDateTime updateTimestamp = LocalDateTime.now();
68
	
73
	
69
	public int getId() {
74
	public int getId() {
70
		return id;
75
		return id;
Line 151... Line 156...
151
    
156
    
152
	@Override
157
	@Override
153
	public int hashCode() {
158
	public int hashCode() {
154
		final int prime = 31;
159
		final int prime = 31;
155
		int result = 1;
160
		int result = 1;
156
		result = prime * result + ((city == null) ? 0 : city.hashCode());
-
 
157
		result = prime * result + ((country == null) ? 0 : country.hashCode());
-
 
158
		result = prime * result + ((createTimestamp == null) ? 0 : createTimestamp.hashCode());
-
 
159
		result = prime * result + customerId;
-
 
160
		result = prime * result + id;
161
		result = prime * result + id;
161
		result = prime * result + ((landmark == null) ? 0 : landmark.hashCode());
-
 
162
		result = prime * result + ((line1 == null) ? 0 : line1.hashCode());
-
 
163
		result = prime * result + ((line2 == null) ? 0 : line2.hashCode());
-
 
164
		result = prime * result + ((name == null) ? 0 : name.hashCode());
-
 
165
		result = prime * result + ((phoneNumber == null) ? 0 : phoneNumber.hashCode());
-
 
166
		result = prime * result + ((pinCode == null) ? 0 : pinCode.hashCode());
-
 
167
		result = prime * result + ((state == null) ? 0 : state.hashCode());
-
 
168
		result = prime * result + ((updateTimestamp == null) ? 0 : updateTimestamp.hashCode());
-
 
169
		return result;
162
		return result;
170
	}
163
	}
171
	@Override
164
	@Override
172
	public boolean equals(Object obj) {
165
	public boolean equals(Object obj) {
173
		if (this == obj)
166
		if (this == obj)
Line 175... Line 168...
175
		if (obj == null)
168
		if (obj == null)
176
			return false;
169
			return false;
177
		if (getClass() != obj.getClass())
170
		if (getClass() != obj.getClass())
178
			return false;
171
			return false;
179
		CustomerAddress other = (CustomerAddress) obj;
172
		CustomerAddress other = (CustomerAddress) obj;
180
		if (city == null) {
-
 
181
			if (other.city != null)
-
 
182
				return false;
-
 
183
		} else if (!city.equals(other.city))
-
 
184
			return false;
-
 
185
		if (country == null) {
-
 
186
			if (other.country != null)
-
 
187
				return false;
-
 
188
		} else if (!country.equals(other.country))
-
 
189
			return false;
-
 
190
		if (createTimestamp == null) {
-
 
191
			if (other.createTimestamp != null)
-
 
192
				return false;
-
 
193
		} else if (!createTimestamp.equals(other.createTimestamp))
-
 
194
			return false;
-
 
195
		if (customerId != other.customerId)
-
 
196
			return false;
-
 
197
		if (id != other.id)
173
		if (id != other.id)
198
			return false;
174
			return false;
199
		if (landmark == null) {
-
 
200
			if (other.landmark != null)
-
 
201
				return false;
-
 
202
		} else if (!landmark.equals(other.landmark))
-
 
203
			return false;
-
 
204
		if (line1 == null) {
-
 
205
			if (other.line1 != null)
-
 
206
				return false;
-
 
207
		} else if (!line1.equals(other.line1))
-
 
208
			return false;
-
 
209
		if (line2 == null) {
-
 
210
			if (other.line2 != null)
-
 
211
				return false;
-
 
212
		} else if (!line2.equals(other.line2))
-
 
213
			return false;
-
 
214
		if (name == null) {
-
 
215
			if (other.name != null)
-
 
216
				return false;
-
 
217
		} else if (!name.equals(other.name))
-
 
218
			return false;
-
 
219
		if (phoneNumber == null) {
-
 
220
			if (other.phoneNumber != null)
-
 
221
				return false;
-
 
222
		} else if (!phoneNumber.equals(other.phoneNumber))
-
 
223
			return false;
-
 
224
		if (pinCode == null) {
-
 
225
			if (other.pinCode != null)
-
 
226
				return false;
-
 
227
		} else if (!pinCode.equals(other.pinCode))
-
 
228
			return false;
-
 
229
		if (state == null) {
-
 
230
			if (other.state != null)
-
 
231
				return false;
-
 
232
		} else if (!state.equals(other.state))
-
 
233
			return false;
-
 
234
		if (updateTimestamp == null) {
-
 
235
			if (other.updateTimestamp != null)
-
 
236
				return false;
-
 
237
		} else if (!updateTimestamp.equals(other.updateTimestamp))
-
 
238
			return false;
-
 
239
		return true;
175
		return true;
240
	}
176
	}
241
	@Override
177
	@Override
242
	public String toString() {
178
	public String toString() {
243
		return "CustomerAddress [id=" + id + ", name=" + name + ", line1=" + line1 + ", line2=" + line2 + ", landmark="
179
		return "CustomerAddress [id=" + id + ", name=" + name + ", line1=" + line1 + ", line2=" + line2 + ", landmark="